forked from openlp/openlp
Only convert bracket tags to chords on songs when chords are enabled.
This commit is contained in:
parent
55f63a0a0f
commit
3b46b8416d
@ -246,6 +246,7 @@ class ServiceItem(RegistryProperties):
|
|||||||
self.renderer.set_item_theme(self.theme)
|
self.renderer.set_item_theme(self.theme)
|
||||||
self.theme_data, self.main, self.footer = self.renderer.pre_render()
|
self.theme_data, self.main, self.footer = self.renderer.pre_render()
|
||||||
if self.service_item_type == ServiceItemType.Text:
|
if self.service_item_type == ServiceItemType.Text:
|
||||||
|
expand_chord_tags = self.name == 'songs' and Settings().value('songs/enable chords')
|
||||||
log.debug('Formatting slides: {title}'.format(title=self.title))
|
log.debug('Formatting slides: {title}'.format(title=self.title))
|
||||||
# Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to
|
# Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to
|
||||||
# the dict instead of rendering them again.
|
# the dict instead of rendering them again.
|
||||||
@ -259,13 +260,13 @@ class ServiceItem(RegistryProperties):
|
|||||||
previous_pages[verse_tag] = (slide['raw_slide'], pages)
|
previous_pages[verse_tag] = (slide['raw_slide'], pages)
|
||||||
for page in pages:
|
for page in pages:
|
||||||
page = page.replace('<br>', '{br}')
|
page = page.replace('<br>', '{br}')
|
||||||
html_data = expand_tags(html.escape(page.rstrip()), self.name == 'songs')
|
html_data = expand_tags(html.escape(page.rstrip()), expand_chord_tags)
|
||||||
new_frame = {
|
new_frame = {
|
||||||
'title': clean_tags(page),
|
'title': clean_tags(page),
|
||||||
'text': clean_tags(page.rstrip(), self.name == 'songs'),
|
'text': clean_tags(page.rstrip(), expand_chord_tags),
|
||||||
'chords_text': expand_chords(clean_tags(page.rstrip(), False)),
|
'chords_text': expand_chords(clean_tags(page.rstrip(), False)),
|
||||||
'html': html_data.replace('&nbsp;', ' '),
|
'html': html_data.replace('&nbsp;', ' '),
|
||||||
'printing_html': expand_tags(html.escape(page.rstrip()), self.name == 'songs', True),
|
'printing_html': expand_tags(html.escape(page.rstrip()), expand_chord_tags, True),
|
||||||
'verseTag': verse_tag,
|
'verseTag': verse_tag,
|
||||||
}
|
}
|
||||||
self._display_frames.append(new_frame)
|
self._display_frames.append(new_frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user