From 5f6e68f076561d392f4448312780f93ca61141fd Mon Sep 17 00:00:00 2001 From: Phillip Kessels Date: Tue, 4 Aug 2020 17:34:08 +0100 Subject: [PATCH] feat: ignore transactions which were not added to history `prosemirror-history` reads a metadata field `addToHistory` and doesn't record changes if a transactions sets it to `false`. I think its reasonable that this plugin ignores these transactions as well as they are not undoable by the undo command anyways. --- src/inputrules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inputrules.js b/src/inputrules.js index 09e17d8..4b785ea 100644 --- a/src/inputrules.js +++ b/src/inputrules.js @@ -56,7 +56,7 @@ export function inputRules({rules}) { apply(tr, prev) { let stored = tr.getMeta(this) if (stored) return stored - return tr.selectionSet || tr.docChanged ? null : prev + return (tr.selectionSet || tr.docChanged) && tr.getMeta('addToHistory') !== false ? null : prev } },