_paginate_slide_words detects long verses itself

This commit is contained in:
Andreas Preikschat 2011-06-13 13:26:06 +02:00
parent f4c00009ed
commit f22e1385be

View File

@ -222,21 +222,23 @@ class Renderer(object):
line_end = u'<br>' line_end = u'<br>'
if item.is_capable(ItemCapabilities.NoLineBreaks): if item.is_capable(ItemCapabilities.NoLineBreaks):
line_end = u' ' line_end = u' '
# clean up line endings # Bibles
if item.is_capable(ItemCapabilities.AllowsWordSplit):
pages = self._paginate_slide_words(text, line_end)
else:
# 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)
#TODO: Maybe move the detection to _paginate_slide.
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):
# Do not forget the line breaks ! # Do not forget the line breaks!
slides = text.split(u'[---]') slides = text.split(u'[---]')
pages = [] pages = []
for slide in slides: for slide in slides:
lines = slide.strip(u'\n').split(u'\n') lines = slide.strip(u'\n').split(u'\n')
pages.extend(self._paginate_slide(lines, line_end)) pages.extend(self._paginate_slide(lines, line_end))
# Bibles
elif item.is_capable(ItemCapabilities.AllowsWordSplit):
pages = self._paginate_slide_words(text, line_end)
new_pages = [] new_pages = []
for page in pages: for page in pages:
while page.endswith(u'<br>'): while page.endswith(u'<br>'):