So, I’ve started using Codemirror and I like it very much so far. However since I’m new I’m not sure on how I can do this particular required feature (or if it’s possible).
Suppose I have a text like:
<custom id="1">Something</custom> This is another text. Hello World <custom id="2">Else</custom>
How could I be able to let the editor know that the ‘custom’ tag is not text to be shown. Instead replace it for something that can be visually styled, so that the user knows (and can see) that is there, but not edit.
Imagine something like: [Something] This is another text. Hello World [Else]
where the bracketed items in bold behave like a single character or element
And also not loose the content, meaning the user will be able to treat said tags as a ‘token’ of sorts he can move around (or possibly delete), however if it’s left in the content I want to be able to retrieve the original value (Something for example). Hope I am explaining myself