slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.82k stars 3.41k forks source link

Quill editor from and to markdown #2514

Closed Doidel closed 5 years ago

Doidel commented 5 years ago

I just wanted to share the solution I use for Quill with markdown. I've used a ton of different markdown editors and solutions (editor.md, tui editor, stackedit...) but then I found this codepen by a guy named "Lee Robert". Those top-notch markdown converters together with Quill work very smoothly. Basically, he uses the markdown-it library to render markdown to html, then pastes the result to Quill. And on saving he uses the to-markdown library to convert the quill.container.firstChild.innerHTML to markdown.

silashuereca commented 3 years ago

Thank you for posting this! I'm using this method now and it works so well :)

duhaime commented 2 years ago

I think more work needs to be done for this to be a viable option. E.g. the initial state of that pen doesn't render properly:

Screen Shot 2022-01-17 at 10 25 29 AM

One of the problems is that quill's output doesn't capture all of its semantics in HTML. Quill renders the list above, for instance, as:

<ol>
  <li>List Item 1</li>
  <li class="ql-indent-1">Point a</li>
</ol>

I believe the semantic HTML would be:

<ol>
  <li>List Item 1</li>
  <ul>
    <li type='a'>Point a</li>
  </ul>
</ol>

There is more discussion of this issue in #979.

Given these challenges, could you please reopen this issue @Doidel?