mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 18:05:55 +01:00
fix: improve <pre> tag regex handling when formatting HTML strings
This commit is contained in:
@@ -304,7 +304,7 @@ function formatHtml(html: string) {
|
|||||||
let pre: { indent: string; tag: string }[] = [];
|
let pre: { indent: string; tag: string }[] = [];
|
||||||
|
|
||||||
html = html
|
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 });
|
pre.push({ indent: "", tag: x });
|
||||||
return "<--TEMPPRE" + i++ + "/-->";
|
return "<--TEMPPRE" + i++ + "/-->";
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user