Is there any ways to append a text/paragraph to the editor's current content?
For example, the current content is "This is the first sentence."
Is there any ways to append "This is the second sentence." to the end?
I found there was a setContent() method, but it replaces all the text content instead.
Get the last position of the document, and dispatch a new transaction where you can call insertText function.
For adding text at the current cursor position you can do this:
const transaction = this.editor.state.tr.insertText('hey!')
this.editor.view.dispatch(transaction)
How to Append tag to current editor's content..?
How to Append tag to current editor's content..?
var elem = "<p>Hey!</p>"
var editorHtml = this.editor.getHTML()
editorHtml += elem
this.editor.setContent(editorHtml)
Most helpful comment
For adding text at the current cursor position you can do this: