Fixed bug #1296104: Renderer broken when two option breaks next to each other

bzr-revno: 2192
Fixes: https://launchpad.net/bugs/1296104
This commit is contained in:
Andreas Preikschat 2014-03-30 12:55:55 +02:00 committed by Raoul Snyman
commit 9e5a80fbd2

View File

@ -284,6 +284,9 @@ class Renderer(object):
elif item.is_capable(ItemCapabilities.CanSoftBreak): elif item.is_capable(ItemCapabilities.CanSoftBreak):
pages = [] pages = []
if u'[---]' in text: if u'[---]' in text:
# Remove two or more option slide breaks next to each other (causing infinite loop).
while u'\n[---]\n[---]\n' in text:
text = text.replace(u'\n[---]\n[---]\n', u'\n[---]\n')
while True: while True:
slides = text.split(u'\n[---]\n', 2) slides = text.split(u'\n[---]\n', 2)
# If there are (at least) two occurrences of [---] we use # If there are (at least) two occurrences of [---] we use