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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
spenwebcommented, Sep 24, 2019

Use clipboard’s convert method to create a delta from an HTML string.

const delta = editorInstance.clipboard.convert(content);

See https://github.com/quilljs/quill/blob/develop/modules/clipboard.js#L81

2reactions
jhchencommented, Jun 27, 2017

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 contenteditable. It is as error-prone as it is because of how inconsistent and ambiguous HTML is. Otherwise Quill has dangerouslyPasteHTML.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to generate a Delta from HTML without ...
I put together a node package to convert html or plain text to and from a Quill Delta. My team used it to...
Read more >
Δ - greek capital letter delta (U+0394) - HTML Symbols
Detailed information about the Unicode character 'Greek capital letter delta' with code point U+0394 that can be used as a symbol or icon...
Read more >
quill-delta-to-html
Converts Quill's delta ops to HTML. Latest version: 0.12.1, last published: 9 months ago. Start using quill-delta-to-html in your project by ...
Read more >
Delta
Deltas can describe any Quill document, includes all text and formatting information, without the ambiguity and complexity of HTML.
Read more >
Delta Equal To HTML Symbol, Character and Entity Codes
HTML symbol, character and entity codes, ASCII, CSS and HEX values for Delta Equal To, plus a panoply of others.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found