Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: encode codeblock for html entities

thecodrr6f2051c4e1c5
diff --git a/packages/core/migrations.js b/packages/core/migrations.js
index 4cdefc6a7..0892ece1d 100644
--- a/packages/core/migrations.js
+++ b/packages/core/migrations.js
@@ -137,7 +137,10 @@ export function tinyToTiptap(html) {
const codeblocks = document.querySelectorAll("pre");
for (const pre of codeblocks) {
- pre.innerHTML = pre.innerText.replace(NEWLINE_TOKEN_REGEX, "<br/>");
+ pre.innerHTML = encodeHTML5(pre.innerText).replace(
+ NEWLINE_TOKEN_REGEX,
+ "<br/>"
+ );
}
const bogus = document.querySelectorAll("[data-mce-bogus]");