forked from openlp/openlp
hopefully fixed bug #796528 (to be cleaned up
Fixes: https://launchpad.net/bugs/796528
This commit is contained in:
parent
b0df1bdd94
commit
0d99f5be96
@ -229,13 +229,33 @@ class Renderer(object):
|
|||||||
pages = self._paginate_slide(lines, line_end)
|
pages = self._paginate_slide(lines, line_end)
|
||||||
if len(pages) > 1:
|
if len(pages) > 1:
|
||||||
# Songs and Custom
|
# Songs and Custom
|
||||||
if item.is_capable(ItemCapabilities.AllowsVirtualSplit):
|
if item.is_capable(ItemCapabilities.AllowsVirtualSplit) and \
|
||||||
# Do not forget the line breaks!
|
u'[---]' in text:
|
||||||
slides = text.split(u'[---]')
|
|
||||||
pages = []
|
pages = []
|
||||||
for slide in slides:
|
while True:
|
||||||
lines = slide.strip(u'\n').split(u'\n')
|
html_text = expand_tags(text.split(u'[---]', 1)[0])
|
||||||
pages.extend(self._paginate_slide(lines, line_end))
|
html_text = html_text.strip()
|
||||||
|
html_text = html_text.replace(u'\n', u'<br>')
|
||||||
|
if not self._text_fits_on_slide(html_text):
|
||||||
|
text = text.replace(u'\n[---]', u'', 1)
|
||||||
|
else:
|
||||||
|
if u'[---]' in text:
|
||||||
|
slides = text.split(u'[---]', 1)
|
||||||
|
text_to_render = slides[0]
|
||||||
|
text_to_render = text_to_render.strip()
|
||||||
|
text_to_render = text_to_render.replace(u'\n', u'<br>')
|
||||||
|
text = slides[1]
|
||||||
|
else:
|
||||||
|
text_to_render = text
|
||||||
|
text = u''
|
||||||
|
lines = text_to_render.strip(u'\n').split(u'\n')
|
||||||
|
lines = map(expand_tags, lines)
|
||||||
|
pages.extend(self._paginate_slide(lines, line_end))
|
||||||
|
if not text or u'[---]' not in text:
|
||||||
|
lines = text.strip(u'\n').split(u'\n')
|
||||||
|
lines = map(expand_tags, lines)
|
||||||
|
pages.extend(self._paginate_slide(lines, line_end))
|
||||||
|
break
|
||||||
new_pages = []
|
new_pages = []
|
||||||
for page in pages:
|
for page in pages:
|
||||||
while page.endswith(u'<br>'):
|
while page.endswith(u'<br>'):
|
||||||
@ -488,7 +508,7 @@ class Renderer(object):
|
|||||||
returned, otherwise ``False``.
|
returned, otherwise ``False``.
|
||||||
|
|
||||||
``text``
|
``text``
|
||||||
The text to check. It can contain HTML tags.
|
The text to check. It may contain HTML tags.
|
||||||
"""
|
"""
|
||||||
self.web_frame.evaluateJavaScript(u'show_text("%s")' %
|
self.web_frame.evaluateJavaScript(u'show_text("%s")' %
|
||||||
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
||||||
|
Loading…
Reference in New Issue
Block a user