forked from openlp/openlp
hopefully completed the fix
This commit is contained in:
parent
6c3d156363
commit
2364ea72c2
@ -227,35 +227,36 @@ class Renderer(object):
|
|||||||
# Clean up line endings.
|
# Clean up line endings.
|
||||||
lines = self._lines_split(text)
|
lines = self._lines_split(text)
|
||||||
pages = self._paginate_slide(lines, line_end)
|
pages = self._paginate_slide(lines, line_end)
|
||||||
if len(pages) > 1:
|
# Songs and Custom
|
||||||
# Songs and Custom
|
if item.is_capable(ItemCapabilities.AllowsVirtualSplit) and \
|
||||||
if item.is_capable(ItemCapabilities.AllowsVirtualSplit) and \
|
len(pages) > 1 and u'[---]' in text:
|
||||||
u'[---]' in text:
|
pages = []
|
||||||
pages = []
|
while True:
|
||||||
while True:
|
html_text = expand_tags(
|
||||||
html_text = expand_tags(text.split(u'[---]', 1)[0])
|
u'\n'.join(text.split(u'\n[---]\n', 2)[:-1]))
|
||||||
html_text = html_text.strip()
|
html_text = html_text.replace(u'\n', u'<br>')
|
||||||
|
if self._text_fits_on_slide(html_text):
|
||||||
|
text = text.replace(u'\n[---]', u'', 2)
|
||||||
|
else:
|
||||||
|
html_text = expand_tags(text.split(u'\n[---]\n', 1)[1])
|
||||||
html_text = html_text.replace(u'\n', u'<br>')
|
html_text = html_text.replace(u'\n', u'<br>')
|
||||||
if self._text_fits_on_slide(html_text):
|
if self._text_fits_on_slide(html_text):
|
||||||
text = text.replace(u'\n[---]', u'', 1)
|
text = text.replace(u'\n[---]', u'', 1)
|
||||||
else:
|
else:
|
||||||
if u'[---]' in text:
|
if u'[---]' in text:
|
||||||
slides = text.split(u'[---]', 1)
|
html_text, text = text.split(u'\n[---]\n', 1)
|
||||||
text_to_render = slides[0]
|
html_text = html_text.replace(u'\n', u'<br>')
|
||||||
text_to_render = text_to_render.strip()
|
|
||||||
text_to_render = text_to_render.replace(u'\n', u'<br>')
|
|
||||||
text = slides[1]
|
|
||||||
else:
|
else:
|
||||||
text_to_render = text
|
html_text = text
|
||||||
text = u''
|
text = u''
|
||||||
lines = text_to_render.strip(u'\n').split(u'\n')
|
lines = expand_tags(html_text)
|
||||||
lines = map(expand_tags, lines)
|
lines = lines.strip(u'\n').split(u'\n')
|
||||||
pages.extend(self._paginate_slide(lines, line_end))
|
pages.extend(self._paginate_slide(lines, line_end))
|
||||||
if not text or u'[---]' not in text:
|
if u'[---]' not in text:
|
||||||
lines = text.strip(u'\n').split(u'\n')
|
lines = expand_tags(text)
|
||||||
lines = map(expand_tags, lines)
|
lines = lines.strip(u'\n').split(u'\n')
|
||||||
pages.extend(self._paginate_slide(lines, line_end))
|
pages.extend(self._paginate_slide(lines, line_end))
|
||||||
break
|
break
|
||||||
new_pages = []
|
new_pages = []
|
||||||
for page in pages:
|
for page in pages:
|
||||||
while page.endswith(u'<br>'):
|
while page.endswith(u'<br>'):
|
||||||
|
Loading…
Reference in New Issue
Block a user