Is there any way to alter the rich text editor’s core behavior?
This post had someone from Weweb saying he’d come back with to help, but never did:
I’m trying to build on top of WW’s rich text editor.
I’ve added a “+” button in the editor’s toolbar. When clicked, I want to trigger some javascript that would insert a given string inside the editor.
document.getElementById('editor').querySelector('div[contenteditable="true"]').appendChild('hello world');
The problem with the code above is that I can’t get the cursor (caret) position within the “contenteditable” div—the text gets added at the end of the element tree.
How do I get the curso…
In my case, I need to add custom parameters to new Editor()
. My goal is to prevent markdown (as well as other stuff like the auto insertion of checkboxes when typing “[” and “]”), and to do so one needs to access or otherwise alter TipTap’s code (see: How to disable markdown behaviour and input/paste rules in Tiptap? · Issue #271 · ueberdosis/tiptap · GitHub ).
Hi, @chrishaha
I’ve answered on that topic.
You will need custom JS. I don’t think you need to change TipTap’s code, at least I didn’t need to with my custom script for that topic. I just selected the element with document.querySelector(‘[contenteditable=“true”]’); and manipulated it with Vanilla JS.