KillerCodeMonkey / ngx-quill

Angular (>=2) components for the Quill Rich Text Editor
MIT License
1.79k stars 264 forks source link

Update to Quill v2 causing issues with embedded videos. #1893

Closed sarmadhadii closed 4 months ago

sarmadhadii commented 4 months ago

We were using Angular 16 with v23 (quill v1). After a file upload to aws, I was embedding the video as follows:

` @ViewChild(QuillEditorComponent) quillEditor: QuillEditorComponent;

this.quillEditor.insertEmbed(index, 'video', url, 'user'); where url was the url of the video `

After our update to Angular 17 with ngx-quill v25 (quill v2), the above code does embed the video... but both [(ngMode)] and getSemanticHtml() return an anchor tag with the href as the URL of the video rather than a video tag. That means, whenever I submit the value retrieved from either of the two above, and then refresh the page... it's actually coming in as an anchor tag.

So for example, what used to be:

`.... html

`

is now:

...html <a href="www.video.mp4">video.mp4</a>

KillerCodeMonkey commented 4 months ago

Please ask this at the quilljs repository, because it seems a quilljs issue.

In general- avoid storing HTML. Using json/object representation is more safe and easier to migrate

Am 15. Juli 2024 21:44:33 MESZ schrieb Sarmad Hadi @.***>:

We were using Angular 16 with v23 (quill v1). After a file upload to aws, I was embedding the video as follows:

` @ViewChild(QuillEditorComponent) quillEditor: QuillEditorComponent;

this.quillEditor.insertEmbed(index, 'video', url, 'user'); where url was the url of the video `

After our update to Angular 17 with ngx-quill v25 (quill v2), the above code does embed the video... but both [(ngMode)] and getSemanticHtml() return an anchor tag with the href as the URL of the video rather than a video tag.

So for example, what used to be:

`.... html

`

is now:

...html <a href="www.video.mp4">video.mp4</a>

-- Reply to this email directly or view it on GitHub: https://github.com/KillerCodeMonkey/ngx-quill/issues/1893 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

sarmadhadii commented 4 months ago

Thanks for the quick reply. I'll ask there.