Skip to content

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

editor: do not save note with codeblock on open

Abdullah Atta19faaea10e1c
diff --git a/packages/editor/src/extensions/code-block/highlighter.ts b/packages/editor/src/extensions/code-block/highlighter.ts
index f3ee92df0..ce73e1b83 100644
--- a/packages/editor/src/extensions/code-block/highlighter.ts
+++ b/packages/editor/src/extensions/code-block/highlighter.ts
@@ -171,6 +171,8 @@ export function HighlighterPlugin({
changedNodes.forEach(({ node, pos }) => {
tr.setNodeMarkup(pos, node.type, node.attrs);
});
+ tr.setMeta("preventUpdate", true);
+ tr.setMeta("addToHistory", false);
view.dispatch(tr);
}
}