Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve attribute class on img tag #4212

Open
firepolo opened this issue May 16, 2024 · 0 comments
Open

Preserve attribute class on img tag #4212

firepolo opened this issue May 16, 2024 · 0 comments

Comments

@firepolo
Copy link

firepolo commented May 16, 2024

Allow the "class" attribute to be retained on "img" tags. This is useful for modules which could add a "class" to images and which should be included in "quill". By default Quill removes the "class" attribute from images in html.

Steps for add this

  1. Goto file: packages\quill\src\formats\image.ts
  2. Replace line 4 by: const ATTRIBUTES = ['class', 'alt', 'height', 'width'];

Expected behavior:
Preserve class attribute in img tag.

Actual behavior:
Remove class attribute from img tag

Improvements:
Maybe add attribute "style" for modules "quill-blot-formatter" for example.

@firepolo firepolo changed the title Keep class attribute on img tag Preserve class attribute on img tag May 16, 2024
@firepolo firepolo changed the title Preserve class attribute on img tag Preserve attribute class on img tag May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant