fletcher / MultiMarkdown-6

Lightweight markup processor to produce HTML, LaTeX, and more.
https://fletcher.github.io/MultiMarkdown-6/
Other
623 stars 90 forks source link

Using image reference and filename with odd number of underscores makes MM not to convert HTML to Markdown #231

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi there,

I have stumbled upon something interesting: if you use image references in the documents and you have odd number of underscores while passing image arguments (size, height, something other) makes multimarkdown fail to convert markdown to html for that referenced image. I am able to reproduce this everytime.

Example

Here is my exact example:

![REFERENCED IMAGE][] 

[REFERENCED IMAGE]: my_fancy_image_1080p.webp "Image title" arg="my_fancy_image_320p.webp 320w, my_fancy_image_500p.webp 500w, my_fancy_image_1080p.webp 1080w" sizes="(max-width: 400px) 100vw, (max-width: 700px) 50vw, (max-width: 900px) 33vw, 320px"

Result

What happens as a result, if i select to convert markdown to html:

<figure>
<img src="my_fancy_image_1080p.webp" alt="REFERENCED IMAGE" id="referencedimage" />
<figcaption>REFERENCED IMAGE</figcaption>
</figure>

What should happen

<figure>
<img src="my_fancy_image_1080p.webp" alt="REFERENCED IMAGE" id="referencedimage" title="Image title" arg="my_fancy_image_320p.webp 320w, my_fancy_image_500p.webp 500w, my_fancy_image_1080p.webp 1080w" sizes="(max-width: 400px) 100vw, (max-width: 700px) 50vw, (max-width: 900px) 33vw, 320px" />
<figcaption>REFERENCED IMAGE</figcaption>
</figure>

I am calling mm with the following command and arguments: multimarkdown --nosmart -t html Version used is 6.6.0

fletcher commented 2 years ago

This was fixed a while ago. Use the development branch to use the latest code, or wait until I push to a new version number (not sure when that will be, but it's time....)