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

Image wrapped in italics renders as text instead of showing the image #51

Closed
njtmead opened this issue Sep 23, 2021 · 2 comments · Fixed by #52
Closed

Image wrapped in italics renders as text instead of showing the image #51

njtmead opened this issue Sep 23, 2021 · 2 comments · Fixed by #52
Assignees
Labels
bug Something isn't working

Comments

@njtmead
Copy link

njtmead commented Sep 23, 2021

Describe the bug

Insert an image to quilljs editor.
Select all (ctrl + a).
Click "italic" icon from quill toolbar.
(my users do this often to italicise their text but inadvertently wrap the image also)

The delta code which generates the Problem

Example:

{"ops":[{"attributes":{"italic":true},"insert":{"image":"https://d3i7mhpybxyfiq.cloudfront.net/original/3xqr7oi10dt67v6zc1e2lv.jpg"}},{"insert":"\n"}]}

The expected html output the delta should produce

anything that creates the img object rather than rendering as text. don't mind where the italic <em> tags end up though they should probably logically wrap the img in this example delta.

Example:

<p><em><img src="https://d3i7mhpybxyfiq.cloudfront.net/original/3xqr7oi10dt67v6zc1e2lv.jpg"></em></p>

What html output the delta is producing instead

Example:

<p><em>{"image":"https:\/\/d3i7mhpybxyfiq.cloudfront.net\/original\/3xqr7oi10dt67v6zc1e2lv.jpg"}</em></p>
@nadar nadar self-assigned this Sep 23, 2021
@nadar nadar added the bug Something isn't working label Sep 23, 2021
@nadar
Copy link
Owner

nadar commented Sep 23, 2021

HI @njtmead Just to understand correctly from our output: The image is not even rendered as img tag, instead its <p><em>{"image":"https:\/\/d3i7mhpybxyfiq.cloudfront.net\/original\/3xqr7oi10dt67v6zc1e2lv.jpg"}</em></p>? I will check that, thanks for the report!

@njtmead
Copy link
Author

njtmead commented Sep 24, 2021

That's correct yes, the image is not being rendered and just showing text instead. Thanks for looking into this.

@nadar nadar closed this as completed in #52 Oct 5, 2021
nadar added a commit that referenced this issue Oct 5, 2021
* handle images before others as they can be wrapped #52

* wrong nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants