diff --git a/content.py b/content.py index 0bf1f9273..387ec7b59 100644 --- a/content.py +++ b/content.py @@ -1351,7 +1351,8 @@ def bold_reading_string(text: str) -> str: reading_markup = False if not reading_markup and len(wrd) > 1 and \ '<' not in wrd and '>' not in wrd and \ - '&' not in wrd and not wrd.startswith(':'): + '&' not in wrd and '=' not in wrd and \ + not wrd.startswith(':'): prefix = '' postfix = '' @@ -1370,6 +1371,8 @@ def bold_reading_string(text: str) -> str: new_parag += wrd + ' ' parag_ctr += 1 new_parag = new_parag.strip() + if not new_parag: + continue if parag_ctr < len(paragraphs): if not add_paragraph_markup: new_text += new_parag + '\n' diff --git a/tests.py b/tests.py index 98d4e4d4a..5bdbb364e 100644 --- a/tests.py +++ b/tests.py @@ -6739,6 +6739,20 @@ def _test_bold_reading() -> None: print(text_bold) assert text_bold == expected + text = '
@Someone or other' + \ + ' some text
' + text_bold = bold_reading_string(text) + expected = \ + '' + \ + '@Someone or other' + \ + ' some text
' + if text_bold != expected: + print(text_bold) + assert text_bold == expected + def run_all_tests(): base_dir = os.getcwd()