StackExchange / pagedown

The Markdown editor and converter used on Stack Overflow and the other Stack Exchange sites
Other
417 stars 81 forks source link

Order of attributes on a HTML img tag can break preview rendering #105

Open stevejalim opened 1 year ago

stevejalim commented 1 year ago

We've noticed (here) that using adding a HTML img tag with a width or height attribute along with an alt attr can fail to render a preview depending on the order of those attributes.

Steps to reproduce:

Using a pagedown-enabled textarea (e.g. the About me section in the Profile editor on StackOverflow.com), enter the following content:

1. <img src="https://placekitten.com/200/300" width="20" alt="This will show">
2. <img src="https://placekitten.com/200/300" alt="This will not show" width="20">
3. <img src="https://placekitten.com/200/300" width="20">

Expected result Three numbered items, each with a small cat picture beside them

Actual result Only the first and third images are shown:

Screenshot 2023-09-04 at 11 20 32

It's not critical, but it has caused us user confusion and pain. Hope this report helps - and thanks!