Inject code (Javascript and Html) at the cursor position or selection in Quill Editor - Stack Overflow

admin2025-04-17  2

In there any way I can attach HTML/Javascript code into the current cursor position using Quill editor?

I have tried so far:

quill.insertText, but if I add a markup <p>some text<p> it's putting the content literal and it doesn't hide the html markup, you can imagine that it doesn't the same if I put function something() {}....

innerHTML: this approach won't work since it will just delete everything I have typed in the editor and will replace it with wherever html markup I passed to inner.

Any idea how this can be done?

转载请注明原文地址:http://anycun.com/QandA/1744840043a88350.html