ocaml / omd

extensible Markdown library and tool in "pure OCaml"
ISC License
156 stars 45 forks source link

fix 215 and 216 #283

Closed tatchi closed 2 years ago

tatchi commented 2 years ago

Test 215

[foo]: /url
bar
===
[foo]

Current result:

<h1>[foo]: /url                     
bar</h1>
<p>[foo]</p>

Expected result:

<h1>bar</h1>
<p><a href="/url">foo</a></p>

The issue is that when parsing a Lsetext_heading (===), we were wrapping all the Rparagraph lines in a Heading, without taking into account that some of the lines might be a link reference definition

Test 216

[foo]: /url
===
[foo]

Current result:

<h1>[foo]: /url</h1>                
<p>[foo]</p>

Expected result:

<p>===
<a href="/url">foo</a></p>

Same as 216 except that in that case there's nothing between the link reference definition and the Lsetext_heading. There's nothing then to make as Heading.