CroudTech / vue-quill

Quill component for vue
MIT License
121 stars 22 forks source link

quill-render is a heavy dependency that may be done-away with #19

Open k8n opened 6 years ago

k8n commented 6 years ago

https://github.com/CroudSupport/vue-quill/blob/fbca7f484d7f54e965d3afa5438eb0b8a551d3f0/package.json#L36

May I suggest a more lightweight approach (done with jQuery, but could probably be done without):

var $h = $('<div>' + this.quill.container.querySelector('.ql-editor').innerHTML + '</div>');
// take only the basic markup
$h.find('*:not(em):not(u):not(strong):not(s):not(br)').contents().unwrap();
var html_content = $h.html();
BrockReece commented 6 years ago

The above code would need us to initialise Quill on the page, right? Quill-render was designed to allow people to convert a Quill delta to html without loading Quill which I presumed would be lighter, I am not married to that idea though. What does Quill's readonly editor look like?

Gladskih commented 4 years ago

While there is no official support of delta-to-html rendering except instantiating Quill the last is the safest way. Now we nearly have next version of Quill (even if the project is dead already) and old custom renderers do not stick with it well.