jgm / cheapskate

Experimental markdown processor in Haskell
BSD 3-Clause "New" or "Revised" License
107 stars 18 forks source link

Escaping HTML twice in image alt tag #15

Closed cbreeden closed 7 years ago

cbreeden commented 8 years ago

While working on a solution for a similar bug on markdown-it, it was brought to my attention that cheapskate may suffer from the same bug. This was detecting using Babelmark 2, which is currently using cheapskate 0.1.0.1; so I am not sure if this has been fixed since or not.

Given an input:

![&](#)

We obtain an output:

<p><img src="#" alt="&amp;amp;" /></p>

Expected output:

<p><img src="#" alt="&amp;" /></p>
jgm commented 8 years ago

I updated babelmark2 to use cheapskate 0.1.0.5 and the problem disappeared.

+++ cbreeden [May 15 16 15:44 ]:

While working on a solution for a [1]similar bug on markdown-it, it was brought to my attention that cheapskate may suffer from the same bug. This was detecting using [2]Babelmark 2, which is currently using cheapskate 0.1.0.1; so I am not sure if this has been fixed since or not.

Given an input: &

We obtain an output:

&amp;

Expected output:

&

— You are receiving this because you are subscribed to this thread. Reply to this email directly or [3]view it on GitHub

References

  1. https://github.com/markdown-it/markdown-it/issues/237
  2. http://johnmacfarlane.net/babelmark2/?text=&
  3. https://github.com/jgm/cheapskate/issues/15