Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix: improve <pre> tag regex handling when formatting HTML strings
SiriusXTfa2188f087ef
diff --git a/apps/client/src/services/utils.ts b/apps/client/src/services/utils.tsindex bf3894474b..a8f4f567fe 100644--- a/apps/client/src/services/utils.ts+++ b/apps/client/src/services/utils.ts@@ -304,7 +304,7 @@ function formatHtml(html: string) {let pre: { indent: string; tag: string }[] = [];html = html- .replace(new RegExp("<pre>((.|\\t|\\n|\\r)+)?</pre>"), function (x) {+ .replace(new RegExp("<pre>([\\s\\S]+?)?</pre>"), function (x) {pre.push({ indent: "", tag: x });return "<--TEMPPRE" + i++ + "/-->";})