forked from openlp/openlp
Merge branch 'format-sup+nbsp-smaller-in-bibles' into 'master'
Smaller bible chapter and verse numbers See merge request openlp/openlp!413
This commit is contained in:
commit
65a9818134
@ -28,7 +28,8 @@ body.hide-mouse {
|
|||||||
|
|
||||||
sup {
|
sup {
|
||||||
vertical-align: super !important;
|
vertical-align: super !important;
|
||||||
font-size: smaller !important;
|
font-size: 50% !important;
|
||||||
|
line-height: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body,
|
body,
|
||||||
|
@ -152,6 +152,10 @@ def remove_tags(text, can_remove_chords=False):
|
|||||||
text = text.replace('<br>', '\n')
|
text = text.replace('<br>', '\n')
|
||||||
text = text.replace('{br}', '\n')
|
text = text.replace('{br}', '\n')
|
||||||
text = text.replace(' ', ' ')
|
text = text.replace(' ', ' ')
|
||||||
|
text = text.replace('<sup>', '')
|
||||||
|
text = text.replace('</sup>', '')
|
||||||
|
text = text.replace('<em>', '')
|
||||||
|
text = text.replace('</em>', '')
|
||||||
for tag in FormattingTags.get_html_tags():
|
for tag in FormattingTags.get_html_tags():
|
||||||
text = text.replace(tag['start tag'], '')
|
text = text.replace(tag['start tag'], '')
|
||||||
text = text.replace(tag['end tag'], '')
|
text = text.replace(tag['end tag'], '')
|
||||||
|
@ -1024,7 +1024,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
DisplayStyle.Curly: ('{', '}'),
|
DisplayStyle.Curly: ('{', '}'),
|
||||||
DisplayStyle.Square: ('[', ']')
|
DisplayStyle.Square: ('[', ']')
|
||||||
}[self.settings_tab.display_style]
|
}[self.settings_tab.display_style]
|
||||||
return '{{su}}{bracket[0]}{verse_text}{bracket[1]}{{/su}} '.format(verse_text=verse_text, bracket=bracket)
|
return '{{su}}{bracket[0]}{verse_text}{bracket[1]} {{/su}}'.format(verse_text=verse_text, bracket=bracket)
|
||||||
|
|
||||||
def search_options(self, option=None):
|
def search_options(self, option=None):
|
||||||
"""
|
"""
|
||||||
|
@ -39,10 +39,22 @@ def test_remove_tags(mocked_get_tags):
|
|||||||
'start tag': '{b}',
|
'start tag': '{b}',
|
||||||
'start html': '<span style="-webkit-text-fill-color:black">',
|
'start html': '<span style="-webkit-text-fill-color:black">',
|
||||||
'end tag': '{/b}', 'end html': '</span>', 'protected': True,
|
'end tag': '{/b}', 'end html': '</span>', 'protected': True,
|
||||||
'temporary': False
|
'temporary': False, 'hidden': False
|
||||||
|
}, {
|
||||||
|
'desc': 'Italics',
|
||||||
|
'start tag': '{it}',
|
||||||
|
'start html': '<em>',
|
||||||
|
'end tag': '{/it}', 'end html': '</em>', 'protected': True,
|
||||||
|
'temporary': False, 'hidden': False
|
||||||
|
}, {
|
||||||
|
'desc': 'Superscript',
|
||||||
|
'start tag': '{su}',
|
||||||
|
'start html': '<sup>',
|
||||||
|
'end tag': '{/su}', 'end html': '</sup>', 'protected': True,
|
||||||
|
'temporary': False, 'hidden': False
|
||||||
}]
|
}]
|
||||||
string_to_pass = 'ASDF<br>foo{br}bar {b}black{/b}'
|
string_to_pass = 'ASDF<br>foo{br}bar {b}black{/b} {su}1,1 {/su}In the {it}beggining{/it}...'
|
||||||
expected_string = 'ASDF\nfoo\nbar black'
|
expected_string = 'ASDF\nfoo\nbar black 1,1 In the beggining...'
|
||||||
|
|
||||||
# WHEN: Clean the string.
|
# WHEN: Clean the string.
|
||||||
result_string = remove_tags(string_to_pass)
|
result_string = remove_tags(string_to_pass)
|
||||||
|
Loading…
Reference in New Issue
Block a user