-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML to Delta #1551
Comments
Quill does not allow arbitrary HTML. It enforces a consistent unambiguous subset so you don't get stuff like: <div>
<div>
<strong>Hello</strong><span></span><b>World</b>
</div>
<p><br></p>
</div> If you need exactly your HTML to show up then your option is really |
Use clipboard's convert method to create a delta from an HTML string.
See https://github.com/quilljs/quill/blob/develop/modules/clipboard.js#L81 |
@lizy0329 are you using quill 2 or quill 1? |
Yes they'll be. |
how do i impelement this in my angularJS app , it gives off error "Uncaught SyntaxError: Cannot use import statement outside a module" |
|
Currenlty,I am using quill's 1.2.6 version. I can able to set the contents as HTML in editor when it has been saved as Delta format. Now in my application I have in plain HTML text format content has been saved in database.
like "
<p><em><span style="text-style:underline">Some text goes here</span></em></p>
" but, these contents are not rendering properly.I have used "
quill.clipboard.dangerouslyPasteHTML
" function which applies some internal matchers and removes original arbitrary HTML contents.Like we have an option for Delta to HTML so is there any option or way to generate the Delta from provided HTML. There is one option to save the contents of the database that is Delta in JSON string format but, I can apply this to the new contents which are being created by using the quill editor, not for existing. Because existing contents are saved in plain HTML format.
Also, I have tried for
quill.root.innerHTML
but it doesn't make any difference.The text was updated successfully, but these errors were encountered: