From 4efed9a1d266ae2f029789e6880866234c49bb92 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 1 Nov 2021 11:27:19 +0100 Subject: [PATCH] improved html importer instruction line break behavior --- cookbook/helper/recipe_url_import.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 2ea889bf4..547ed2e40 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -246,7 +246,10 @@ def parse_instructions(instructions): instruction_text += str(i) instructions = instruction_text - return normalize_string(instructions) + normalized_string = normalize_string(instructions) + normalized_string = normalized_string.replace('\n', ' \n') + normalized_string = normalized_string.replace(' \n \n', '\n\n') + return normalized_string def parse_image(image):