diff --git a/content.py b/content.py index 52eb33391..36cc39cff 100644 --- a/content.py +++ b/content.py @@ -2207,9 +2207,9 @@ def format_mixed_right_to_left(content: str, # not a RTL language if language_right_to_left(language): return content - paragraphs = content.split('
') result = '' changed = False + paragraphs = content.split('
') for text_html in paragraphs: if '
' not in text_html: continue @@ -2220,6 +2220,23 @@ def format_mixed_right_to_left(content: str, text_html = text_html.replace('', '', 1) changed = True result += text_html + if not changed: + paragraphs = content.split('This is some English
' + \ 'And more English
' + if result != expected: + print('Expected: ' + expected) + print('Result: ' + result) assert result == expected content = 'This is some only English
' @@ -8148,6 +8151,18 @@ def _test_format_mixed_rtl() -> None: result = format_mixed_right_to_left(content, 'ar') assert result == content + content = 'This is some English