Hi I’m tasked with adding support for variables to our prosemirror implementation. So far when a user selects a piece of text a context menu shows up. The user then clicks on the option to make that current selection a variable. This then gets added to the DB along with the ranges etc. A decoration then gets added to the initially selected text. Now 2 things should happen which I can’t seem to fix.
1: the variable mark should be deselected after it has been applied. Right now whatever you type after applying will be part of the variable. I tried adding transaction.setStoredMarks(null) after the inital mark transaction but with no success.
- when the user modifies the variable in any way it should remove the entire mark and update the db. Right now I added the initial selection as metaData on the mark to be able to perform the comparisons. However Im not sure if im approaching it the right way.