I’m building a markdown editor and I want to make something similar to StackEdit, where you have a split screen with a text editor at the left and the markdown preview at the right.
What I want is to build the part of the left, where you basically write some markdown, it is applied to the same text and also you can see the tokens.
As an example, here’s an image:
You see the # or the ** in a grey color, but it is applied to the text and the token is still there.
I hope I’m clear! Thanks!
You could fake them with :before style rules and such. But if you want to allow people to edit those characters directly, you might be better off building on top of something like CodeMirror
It’s a text editor that you can set up to keep a Markdown parse tree of your code on the side, so it’ll make a textual editing approach easier to implement than a rich text editor will. But either way this is not going to be an easy thing to build.
But the are input rules not working when, for instance, I write **some text**, which is supposed to make the text bold. This seems to be related to (please correct me) wrappingInputRule vs textblockTypeInputRule or maybe nodes vs marks. Can you give me a small guidance on this, or where to see to be able to make an input rule for this: **some text**?
Thanks so much in advance, I really appreciate your answers!