minor improvement for such cases where [---] was used

This commit is contained in:
Andreas Preikschat 2011-09-24 14:54:27 +02:00
parent b776015ae9
commit 9841406071

View File

@ -224,13 +224,8 @@ class Renderer(object):
# Bibles
if item.is_capable(ItemCapabilities.CanWordSplit):
pages = self._paginate_slide_words(text.split(u'\n'), line_end)
else:
# Clean up line endings.
lines = self._lines_split(text)
pages = self._paginate_slide(lines, line_end)
# Songs and Custom
if item.is_capable(ItemCapabilities.CanSoftBreak) and \
len(pages) > 1 and u'[---]' in text:
elif item.is_capable(ItemCapabilities.CanSoftBreak):
pages = []
while True:
slides = text.split(u'\n[---]\n', 2)
@ -272,6 +267,9 @@ class Renderer(object):
lines = text.strip(u'\n').split(u'\n')
pages.extend(self._paginate_slide(lines, line_end))
break
else:
# Clean up line endings.
pages = self._paginate_slide(text.split(u'\n'), line_end)
new_pages = []
for page in pages:
while page.endswith(u'<br>'):
@ -585,12 +583,3 @@ class Renderer(object):
# this parse we are to be wordy
line = line.replace(u'\n', u' ')
return line.split(u' ')
def _lines_split(self, text):
"""
Split the slide up by physical line
"""
# this parse we do not want to use this so remove it
text = text.replace(u'\n[---]', u'')
text = text.replace(u'[---]', u'')
return text.split(u'\n')