forked from openlp/openlp
replaced <br> by <br />
This commit is contained in:
parent
39caaca8d9
commit
74d2b2d25c
@ -202,7 +202,7 @@ def clean_tags(text):
|
|||||||
"""
|
"""
|
||||||
Remove Tags from text for display
|
Remove Tags from text for display
|
||||||
"""
|
"""
|
||||||
text = text.replace(u'<br>', u'\n')
|
text = text.replace(u'<br />', u'\n')
|
||||||
text = text.replace(u'{br}', u'\n')
|
text = text.replace(u'{br}', u'\n')
|
||||||
text = text.replace(u' ', u' ')
|
text = text.replace(u' ', u' ')
|
||||||
for tag in DisplayTags.get_html_tags():
|
for tag in DisplayTags.get_html_tags():
|
||||||
|
@ -219,7 +219,7 @@ class Renderer(object):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'format slide')
|
log.debug(u'format slide')
|
||||||
# Add line endings after each line of text used for bibles.
|
# Add line endings after each line of text used for bibles.
|
||||||
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' '
|
||||||
# Bibles
|
# Bibles
|
||||||
@ -240,7 +240,7 @@ class Renderer(object):
|
|||||||
pages.extend(self._paginate_slide(lines, line_end))
|
pages.extend(self._paginate_slide(lines, line_end))
|
||||||
new_pages = []
|
new_pages = []
|
||||||
for page in pages:
|
for page in pages:
|
||||||
while page.endswith(u'<br>'):
|
while page.endswith(u'<br />'):
|
||||||
page = page[:-4]
|
page = page[:-4]
|
||||||
new_pages.append(page)
|
new_pages.append(page)
|
||||||
return new_pages
|
return new_pages
|
||||||
@ -326,13 +326,13 @@ class Renderer(object):
|
|||||||
The text to be fitted on the slide split into lines.
|
The text to be fitted on the slide split into lines.
|
||||||
|
|
||||||
``line_end``
|
``line_end``
|
||||||
The text added after each line. Either ``u' '`` or ``u'<br>``.
|
The text added after each line. Either ``u' '`` or ``u'<br />``.
|
||||||
"""
|
"""
|
||||||
log.debug(u'_paginate_slide - Start')
|
log.debug(u'_paginate_slide - Start')
|
||||||
formatted = []
|
formatted = []
|
||||||
previous_html = u''
|
previous_html = u''
|
||||||
previous_raw = u''
|
previous_raw = u''
|
||||||
separator = u'<br>'
|
separator = u'<br />'
|
||||||
html_lines = map(expand_tags, lines)
|
html_lines = map(expand_tags, lines)
|
||||||
html = self.page_shell + separator.join(html_lines) + HTML_END
|
html = self.page_shell + separator.join(html_lines) + HTML_END
|
||||||
self.web.setHtml(html)
|
self.web.setHtml(html)
|
||||||
@ -357,7 +357,7 @@ class Renderer(object):
|
|||||||
The words to be fitted on the slide split into lines.
|
The words to be fitted on the slide split into lines.
|
||||||
|
|
||||||
``line_end``
|
``line_end``
|
||||||
The text added after each line. Either ``u' '`` or ``u'<br>``. This
|
The text added after each line. Either ``u' '`` or ``u'<br />``. This
|
||||||
is needed for bibles.
|
is needed for bibles.
|
||||||
"""
|
"""
|
||||||
log.debug(u'_paginate_slide_words - Start')
|
log.debug(u'_paginate_slide_words - Start')
|
||||||
@ -434,12 +434,12 @@ class Renderer(object):
|
|||||||
using the binary chop. The elements can contain display tags.
|
using the binary chop. The elements can contain display tags.
|
||||||
|
|
||||||
``separator``
|
``separator``
|
||||||
The separator for the elements. For lines this is ``u'<br>'`` and
|
The separator for the elements. For lines this is ``u'<br />'`` and
|
||||||
for words this is ``u' '``.
|
for words this is ``u' '``.
|
||||||
|
|
||||||
``line_end``
|
``line_end``
|
||||||
The text added after each "element line". Either ``u' '`` or
|
The text added after each "element line". Either ``u' '`` or
|
||||||
``u'<br>``. This is needed for bibles.
|
``u'<br />``. This is needed for bibles.
|
||||||
"""
|
"""
|
||||||
smallest_index = 0
|
smallest_index = 0
|
||||||
highest_index = len(html_list) - 1
|
highest_index = len(html_list) - 1
|
||||||
@ -459,7 +459,7 @@ class Renderer(object):
|
|||||||
# We found the number of words which will fit.
|
# We found the number of words which will fit.
|
||||||
if smallest_index == index or highest_index == index:
|
if smallest_index == index or highest_index == index:
|
||||||
index = smallest_index
|
index = smallest_index
|
||||||
formatted.append(previous_raw.rstrip(u'<br>') +
|
formatted.append(previous_raw.rstrip(u'<br />') +
|
||||||
separator.join(raw_list[:index + 1]))
|
separator.join(raw_list[:index + 1]))
|
||||||
previous_html = u''
|
previous_html = u''
|
||||||
previous_raw = u''
|
previous_raw = u''
|
||||||
|
@ -174,7 +174,7 @@ class ServiceItem(object):
|
|||||||
for slide in self._raw_frames:
|
for slide in self._raw_frames:
|
||||||
pages = self.renderer.format_slide(slide[u'raw_slide'], self)
|
pages = self.renderer.format_slide(slide[u'raw_slide'], self)
|
||||||
for page in pages:
|
for page in pages:
|
||||||
page = page.replace(u'<br>', u'{br}')
|
page = page.replace(u'<br />', u'{br}')
|
||||||
html = expand_tags(cgi.escape(page.rstrip()))
|
html = expand_tags(cgi.escape(page.rstrip()))
|
||||||
self._display_frames.append({
|
self._display_frames.append({
|
||||||
u'title': clean_tags(page),
|
u'title': clean_tags(page),
|
||||||
@ -194,7 +194,7 @@ class ServiceItem(object):
|
|||||||
if self.raw_footer is None:
|
if self.raw_footer is None:
|
||||||
self.raw_footer = []
|
self.raw_footer = []
|
||||||
self.foot_text = \
|
self.foot_text = \
|
||||||
u'<br>'.join([footer for footer in self.raw_footer if footer])
|
u'<br />'.join([footer for footer in self.raw_footer if footer])
|
||||||
|
|
||||||
def add_from_image(self, path, title):
|
def add_from_image(self, path, title):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user