Open raimotheculturefactor opened 6 months ago
I worked around this by removing the html() method from the video format. video.js has a function called html() which returns <a href="${video}">${video}</a>
and is called by editor.js convertHTML(). By overriding the video format with a class with html() undefined, the HTML generation reverted back to the old behaviour of creating an iframe.
This is from an Angular using ngx-quill and written in TypeScript, but I assume doing something similar following the customization docs will work in plain JS:
import QuillVideo from 'quill/formats/video'
// Eliminate the html method so that convertHTML does not turn the iframe into a anchor tag
// which it then fails to convert back to an iframe when it loads.
export class MyQuillVideo extends QuillVideo {
html = null;
}
// and in my ngx-quill options:
customModules: [
{ path: 'formats/video', implementation: MyQuillVideo }
]
I'm adding an embedded video in the editor. The editor shows the video in an iframe. My problem is when I want to get the html content from the editor. It returns a link, not the iframe as whole.
Steps for Reproduction
Expected behavior:
expecting the return value be:
Actual behavior:
<a href="${video}">${video}</a>
is returnedPlatforms:
windows
Version:
2.0.*