How do I convert Deltas to pure HTML? I'm using Quill as a rich text editor, but I'm not sure how I would display the existing Deltas in a HTML context. Creating multiple Quill instances wouldn't be reasonable, but I couldn't come up with anything better yet.
I did my research, and I didn't find any way to do this.
I just use - $("#form"). find('#quill-editor . ql-editor'). html();
Deltas are a simple, yet expressive format that can be used to describe Quill's contents and changes. The format is a strict subset of JSON, is human readable, and easily parsible by machines.
Learn how to use react-quill by viewing and forking example apps that make use of react-quill on CodeSandbox. Custom Toolbar with React Quill (Fully working)Quill test with a custom toolbar built with an HTML template. The toolbar includes custom font families, custom font sizes and a custom button.
Not very elegant, but this is how I had to do it.
function quillGetHTML(inputDelta) { var tempCont = document.createElement("div"); (new Quill(tempCont)).setContents(inputDelta); return tempCont.getElementsByClassName("ql-editor")[0].innerHTML; }
Obviously this needs quill.js.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With