mixmark-io / turndown

🛏 An HTML to Markdown converter written in JavaScript
https://mixmark-io.github.io/turndown
MIT License
8.82k stars 880 forks source link

Image URLs are not properly escaped #473

Open pavelhoral opened 3 months ago

pavelhoral commented 3 months ago

I finally got around to verify this issue, however it was fixed for links but not for images.

this html:

<img src="https://google.com/file 1).jpg" />

produces this markdown:

![](https://google.com/file 1).jpg)

In this example I used an unbalanced bracket, as per earlier comments. I can confirm the fix for links handles both balanced and unbalanced brackets, which would be my preferred fix.

using 7.2.0

Originally posted by @shaipetel in https://github.com/mixmark-io/turndown/issues/459#issuecomment-2230951133