I really appreciate your timely help with all these issues/questions. Sorry for another one here...
I am a little confused about how to get the HTML document from the editor.
In issue #555 I mentioned how I was getting it using ref in React, but this is not always working well. (Sometimes returns blank after adding attachments or doing other things).
I understand how to get an instance of the document from the editor
const editor = document.querySelector("trix-editor").editor;
const fileContent = editor.getDocument();
and this returns an object like this
{id: 3641, blockList: i(1)}
I can also get the plain text from the document by doing this:
fileContent.toString();
But how do I get a string with the html of the document using editor.getDocument() ?
Use element.value to get the HTML string.
Most helpful comment
Use
element.valueto get the HTML string.