From 713c6db446ee7b9a691af7351eda5e72cc8981a1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 20 Sep 2023 14:00:36 +0100 Subject: [PATCH] Distill line breaks --- content.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content.py b/content.py index 00a6b9608..f7a1b3f05 100644 --- a/content.py +++ b/content.py @@ -2222,7 +2222,12 @@ def format_mixed_right_to_left(content: str, result += text_html if not changed: result = '' - paragraphs = content.split('

') + prev_distilled = '' + distilled = content + while prev_distilled != distilled: + prev_distilled = distilled + distilled = distilled.replace('


', '

') + paragraphs = distilled.split('

') ctr = 0 for text_html in paragraphs: ctr += 1