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 disappears from the note preview if a width and/or height is specified #783

Closed
pmac opened this issue Aug 29, 2023 · 3 comments
Closed
Labels

Comments

@pmac
Copy link
Member

pmac commented Aug 29, 2023

When using an <img> tag, Nucleus' preview will show the image when just the src and alt are specified, but once width or height are added, the image disappears. The images do load correctly on Bedrock, however.

imported from https://bugzilla.mozilla.org/show_bug.cgi?id=1850060

@pmac pmac added the bug label Aug 29, 2023
@stevejalim
Copy link
Contributor

That sounds like a bleaching / allowed attrs configuration thing. Will take a look as soon as I can

@pmac
Copy link
Member Author

pmac commented Aug 30, 2023

I would think so, but it happens in the client-side auto-updating preview and I'm not sure Python is involved, but they might have something similar in the JS.

@stevejalim
Copy link
Contributor

stevejalim commented Sep 4, 2023

OK so playing about with this to reproduce, I can make it work with no code changes to Nucleus.

The niggle is rooted in the pagedown library, which we use off-the-shelf, so I tried to reproduce the same issue using it on StackOverflow's profile editor and discovered the same behaviour.

Fiddling around there I discovered that the order of the attributes seems to matter here so this works fine

<img src="https://placekitten.com/200/200" width="20" alt="test image of some cats">

But this does not
<img src="https://placekitten.com/200/200" alt="test image of some cats" width="20">

I've tried the same in Nucleus, locally, and can confirm the attribute order 'fix' also works for us too - see this screen recording

@rvandermeulen is this OK as a workaround for you? If so, please feel free to close this Issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants