From 69623677e9a40f2e4e0fa2646d8b053ea111b02d Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Fri, 20 Dec 2024 21:54:40 +0100 Subject: [PATCH] Replace

with
and reeduce number of
--- src/scripts/export_consolidated_text_to_git.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scripts/export_consolidated_text_to_git.ts b/src/scripts/export_consolidated_text_to_git.ts index e26ffa5..e80a82e 100644 --- a/src/scripts/export_consolidated_text_to_git.ts +++ b/src/scripts/export_consolidated_text_to_git.ts @@ -375,7 +375,14 @@ async function cleanHtmlFragment( return fragment === undefined ? undefined : await prettier.format( - fragment.replaceAll("<<", "«").replaceAll(">>", "»"), + fragment + .replaceAll("<<", "«") + .replaceAll(">>", "»") + .replace(/

(.*?)<\/p>/gs, "$1
\n\n") + .replace(/\s*(\s*)+/gs, "
\n\n") + .replace(/^\s*(\s*)+/gs, "") + .replace(/\s*(\s*)+$/gs, "") + .trim(), { parser: "html", },