forked from openlp/openlp
Fix soft break
This commit is contained in:
parent
0476fe8b27
commit
c9d69c55cd
@ -217,22 +217,21 @@ class Renderer(object):
|
|||||||
log.debug(u'format slide')
|
log.debug(u'format slide')
|
||||||
# clean up line endings
|
# clean up line endings
|
||||||
lines = self._lines_split(text)
|
lines = self._lines_split(text)
|
||||||
# Songs and Custom
|
pages = self._paginate_slide(lines, line_break, self.force_page)
|
||||||
if item.is_capable(ItemCapabilities.AllowsVirtualSplit):
|
if len(pages) > 1:
|
||||||
# Do not forget the line breaks !
|
# Songs and Custom
|
||||||
slides = text.split(u'\n[---]\n')
|
if item.is_capable(ItemCapabilities.AllowsVirtualSplit):
|
||||||
pages = []
|
# Do not forget the line breaks !
|
||||||
for slide in slides:
|
slides = text.split(u'\n[---]\n')
|
||||||
lines = self._lines(slide)
|
pages = []
|
||||||
new_pages = self._paginate_slide(lines, line_break,
|
for slide in slides:
|
||||||
self.force_page)
|
lines = self._lines(slide)
|
||||||
pages.extend([page for page in new_pages])
|
new_pages = self._paginate_slide(lines, line_break,
|
||||||
# Bibles
|
self.force_page)
|
||||||
elif item.is_capable(ItemCapabilities.AllowsWordSplit):
|
pages.extend([page for page in new_pages])
|
||||||
pages = self._paginate_slide_words(text, line_break)
|
# Bibles
|
||||||
# Theme preview "service items".
|
elif item.is_capable(ItemCapabilities.AllowsWordSplit):
|
||||||
else:
|
pages = self._paginate_slide_words(text, line_break)
|
||||||
pages = self._paginate_slide(lines, line_break, self.force_page)
|
|
||||||
return pages
|
return pages
|
||||||
|
|
||||||
def _calculate_default(self, screen):
|
def _calculate_default(self, screen):
|
||||||
@ -376,7 +375,7 @@ class Renderer(object):
|
|||||||
formatted = []
|
formatted = []
|
||||||
previous_html = u''
|
previous_html = u''
|
||||||
previous_raw = u''
|
previous_raw = u''
|
||||||
lines = self._lines(text, u'[---]')
|
lines = self._lines(text)
|
||||||
for line in lines:
|
for line in lines:
|
||||||
styled_line = expand_tags(line)
|
styled_line = expand_tags(line)
|
||||||
html = self.page_shell + previous_html + styled_line + HTML_END
|
html = self.page_shell + previous_html + styled_line + HTML_END
|
||||||
@ -408,7 +407,7 @@ class Renderer(object):
|
|||||||
log.debug(u'_paginate_slide_words - End')
|
log.debug(u'_paginate_slide_words - End')
|
||||||
return formatted
|
return formatted
|
||||||
|
|
||||||
def _lines(self, text, split=u'\n[---]\n'):
|
def _lines(self, text):
|
||||||
"""
|
"""
|
||||||
Split the slide up by physical line
|
Split the slide up by physical line
|
||||||
"""
|
"""
|
||||||
@ -442,7 +441,7 @@ class Renderer(object):
|
|||||||
lines = text.split(u'\n')
|
lines = text.split(u'\n')
|
||||||
real_lines = []
|
real_lines = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line = line.replace(u' [---]', u'[---]')
|
line = line.replace(u'[---]', u'')
|
||||||
sub_lines = line.split(u'\n')
|
sub_lines = line.split(u'\n')
|
||||||
real_lines.extend([sub_line for sub_line in sub_lines])
|
real_lines.extend([sub_line for sub_line in sub_lines])
|
||||||
return real_lines
|
return real_lines
|
||||||
|
Loading…
Reference in New Issue
Block a user