This commit is contained in:
Andreas Preikschat 2014-04-29 13:04:19 +02:00
parent 5a2793bc50
commit 282ed7e1a6

View File

@ -249,8 +249,8 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
pages = [] pages = []
if '[---]' in text: if '[---]' in text:
# Remove two or more option slide breaks next to each other (causing infinite loop). # Remove two or more option slide breaks next to each other (causing infinite loop).
while u'\n[---]\n[---]\n' in text: while '\n[---]\n[---]\n' in text:
text = text.replace(u'\n[---]\n[---]\n', u'\n[---]\n') text = text.replace('\n[---]\n[---]\n', '\n[---]\n')
while True: while True:
slides = text.split('\n[---]\n', 2) slides = text.split('\n[---]\n', 2)
# If there are (at least) two occurrences of [---] we use the first two slides (and neglect the last # If there are (at least) two occurrences of [---] we use the first two slides (and neglect the last
@ -395,7 +395,7 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
off when displayed. off when displayed.
:param lines: The text to be fitted on the slide split into lines. :param lines: The text to be fitted on the slide split into lines.
:param line_end: The text added after each line. Either ``u' '`` or ``u'<br>``. :param line_end: The text added after each line. Either ``' '`` or ``'<br>``.
""" """
formatted = [] formatted = []
previous_html = '' previous_html = ''
@ -419,7 +419,7 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
processed word by word. This is sometimes need for **bible** verses. processed word by word. This is sometimes need for **bible** verses.
:param lines: The text to be fitted on the slide split into lines. :param lines: The text to be fitted on the slide split into lines.
:param line_end: The text added after each line. Either ``u' '`` or ``u'<br>``. This is needed for **bibles**. :param line_end: The text added after each line. Either ``' '`` or ``'<br>``. This is needed for **bibles**.
""" """
formatted = [] formatted = []
previous_html = '' previous_html = ''
@ -456,7 +456,7 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
""" """
Tests the given text for not closed formatting tags and returns a tuple consisting of three unicode strings:: Tests the given text for not closed formatting tags and returns a tuple consisting of three unicode strings::
(u'{st}{r}Text text text{/r}{/st}', u'{st}{r}', u'<strong><span style="-webkit-text-fill-color:red">') ('{st}{r}Text text text{/r}{/st}', '{st}{r}', '<strong><span style="-webkit-text-fill-color:red">')
The first unicode string is the text, with correct closing tags. The second unicode string are OpenLP's opening The first unicode string is the text, with correct closing tags. The second unicode string are OpenLP's opening
formatting tags and the third unicode string the html opening formatting tags. formatting tags and the third unicode string the html opening formatting tags.
@ -503,8 +503,8 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
The text contains html. The text contains html.
:param raw_list: The elements which do not fit on a slide and needs to be processed using the binary chop. :param raw_list: The elements which do not fit on a slide and needs to be processed using the binary chop.
The elements can contain formatting tags. The elements can contain formatting tags.
:param separator: The separator for the elements. For lines this is ``u'<br>'`` and for words this is ``u' '``. :param separator: The separator for the elements. For lines this is ``'<br>'`` and for words this is ``' '``.
:param line_end: The text added after each "element line". Either ``u' '`` or ``u'<br>``. This is needed for :param line_end: The text added after each "element line". Either ``' '`` or ``'<br>``. This is needed for
bibles. bibles.
""" """
smallest_index = 0 smallest_index = 0