You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the video module to embed a YouTube clip, quill.editor.getHTML(0, quill.getLenth()) or quill.getSemanticHTML() converts the iframe to a hyperlink.
constquill=newQuill('#editor',{modules: {toolbar: [['video'],],},placeholder: 'Compose an epic...',theme: 'snow',// or 'bubble'});constdivOutput=document.createElement('div');quill.container.insertAdjacentElement('afterend',divOutput);divOutput.textContent='Insert video';quill.on('text-change',()=>{divOutput.textContent=quill.getSemanticHTML();});
Expected behavior: embeds and their attributes (i.e. src, height, width, classList etc) should be preserved
Actual behavior: it's converted to an hyperlink. Outputting as a hyperlink makes getHTML and getSemanticHTML() unusable for its intended purpose since this should be a direct HTML representation of the editor contents.
Platforms: quilljs 2.0.2, windows 10, chrome
Version: 2.0.2
The text was updated successfully, but these errors were encountered:
enzedonline
changed the title
getSemanticHTML strips embed, replaces with hyperlink
getHTML/getSemanticHTML strips embed, replaces with hyperlink
Jun 30, 2024
@skillcapesoftware weird, I can link to other issues in that comment but not that issue, but it works here ... #4289.
This issue isn't resolved, it's just combined with a few other issues with getSemanticHTML listed on the other one. It's caused by the html method of Quill's video embed.
The workaround for video is to create a custom embed extending the video embed and overriding the html method. Something like:
When using the video module to embed a YouTube clip,
quill.editor.getHTML(0, quill.getLenth())
orquill.getSemanticHTML()
converts the iframe to a hyperlink.Steps for Reproduction
Quill playground link.
Example editor video html:
getSemanticHTML output:
Expected behavior: embeds and their attributes (i.e. src, height, width, classList etc) should be preserved
Actual behavior: it's converted to an hyperlink. Outputting as a hyperlink makes
getHTML
andgetSemanticHTML()
unusable for its intended purpose since this should be a direct HTML representation of the editor contents.Platforms: quilljs 2.0.2, windows 10, chrome
Version: 2.0.2
The text was updated successfully, but these errors were encountered: