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 {
|
||||
vertical-align: super !important;
|
||||
font-size: smaller !important;
|
||||
font-size: 50% !important;
|
||||
line-height: 0 !important;
|
||||
}
|
||||
|
||||
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(' ', ' ')
|
||||
text = text.replace('<sup>', '')
|
||||
text = text.replace('</sup>', '')
|
||||
text = text.replace('<em>', '')
|
||||
text = text.replace('</em>', '')
|
||||
for tag in FormattingTags.get_html_tags():
|
||||
text = text.replace(tag['start tag'], '')
|
||||
text = text.replace(tag['end tag'], '')
|
||||
|
@ -1024,7 +1024,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
DisplayStyle.Curly: ('{', '}'),
|
||||
DisplayStyle.Square: ('[', ']')
|
||||
}[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):
|
||||
"""
|
||||
|
@ -39,10 +39,22 @@ def test_remove_tags(mocked_get_tags):
|
||||
'start tag': '{b}',
|
||||
'start html': '<span style="-webkit-text-fill-color:black">',
|
||||
'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}'
|
||||
expected_string = 'ASDF\nfoo\nbar black'
|
||||
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 1,1 In the beggining...'
|
||||
|
||||
# WHEN: Clean the string.
|
||||
result_string = remove_tags(string_to_pass)
|
||||
|
Loading…
Reference in New Issue
Block a user