From 6e8851ae5693c56a755ce207bd5260d6a86f4be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20M=C3=A1t=C3=A9?= Date: Thu, 10 Feb 2022 12:10:13 +0000 Subject: [PATCH] Smaller bible chapter and verse numbers --- openlp/core/display/html/display.css | 3 ++- openlp/core/display/render.py | 4 ++++ openlp/plugins/bibles/lib/mediaitem.py | 2 +- tests/openlp_core/display/test_render.py | 18 +++++++++++++++--- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/openlp/core/display/html/display.css b/openlp/core/display/html/display.css index 983f68436..5307e589a 100644 --- a/openlp/core/display/html/display.css +++ b/openlp/core/display/html/display.css @@ -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, diff --git a/openlp/core/display/render.py b/openlp/core/display/render.py index 5fb487093..82091a84a 100644 --- a/openlp/core/display/render.py +++ b/openlp/core/display/render.py @@ -152,6 +152,10 @@ def remove_tags(text, can_remove_chords=False): text = text.replace('
', '\n') text = text.replace('{br}', '\n') text = text.replace(' ', ' ') + text = text.replace('', '') + text = text.replace('', '') + text = text.replace('', '') + text = text.replace('', '') for tag in FormattingTags.get_html_tags(): text = text.replace(tag['start tag'], '') text = text.replace(tag['end tag'], '') diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index e12001201..8446f454d 100755 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -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): """ diff --git a/tests/openlp_core/display/test_render.py b/tests/openlp_core/display/test_render.py index 79945b418..fdf0200ca 100644 --- a/tests/openlp_core/display/test_render.py +++ b/tests/openlp_core/display/test_render.py @@ -39,10 +39,22 @@ def test_remove_tags(mocked_get_tags): 'start tag': '{b}', 'start html': '', 'end tag': '{/b}', 'end html': '', 'protected': True, - 'temporary': False + 'temporary': False, 'hidden': False + }, { + 'desc': 'Italics', + 'start tag': '{it}', + 'start html': '', + 'end tag': '{/it}', 'end html': '', 'protected': True, + 'temporary': False, 'hidden': False + }, { + 'desc': 'Superscript', + 'start tag': '{su}', + 'start html': '', + 'end tag': '{/su}', 'end html': '', 'protected': True, + 'temporary': False, 'hidden': False }] - string_to_pass = 'ASDF
foo{br}bar {b}black{/b}' - expected_string = 'ASDF\nfoo\nbar black' + string_to_pass = 'ASDF
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)