fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
307 stars 59 forks source link

Well formed HTML/XML with missing figure definition #121

Closed mn4367 closed 9 years ago

mn4367 commented 9 years ago

The following snippet

Lorem ipsum.

![Caption][fig1]

Lorem ipsum.

[fig1]: sample.png

produces

<p>Lorem ipsum.</p>

<figure>
<img src="sample.png" alt="Caption" id="fig1" />
<figcaption>Caption</figcaption>
</figure>

<p>Lorem ipsum.</p>

which is fine. But if i I delete the image definition or if I use it incorrectly like in the following two examples

Lorem ipsum.

![Caption][fig1]

Lorem ipsum.
Lorem ipsum.

![Caption][fig0]

Lorem ipsum.

[fig1]: sample.png

this HTML is produced:

<p>Lorem ipsum.</p>

<figure>
![Caption][fig1]

<p>Lorem ipsum.</p>
<p>Lorem ipsum.</p>

<figure>
![Caption][fig0]

<p>Lorem ipsum.</p>

The figure tag isn't closed which prevents further processing in tools which demand well-formed XML.

I'm of course guilty of wrong markdown syntax, but it would be very nice if MultiMarkdown would just close the figure tag in such cases.

fletcher commented 9 years ago

Thanks!

mn4367 commented 9 years ago

Thank you! :-)