Skip to content

md2html and cmark differ on ATX headings #278

@step-

Description

@step-

Given the following Markdown involving four headings, md2html's and cmark's results diverged on the third and fourth headings.

Mardown:

# _h _

# _h _[](<#_h%20_>)

# _h _[](<#h-_>)

# _h _[](<#h__>)

md2html 0.5.2 output (Linux):

<h1>_h _</h1>
<h1>_h _<a href="#_h%20_"></a></h1>
<h1>_h <em><a href="#h-_"></a></h1>
<h1><em>h <em><a href="#h__"></a></h1>

cmark 0.31.1 output:

<h1>_h _</h1>
<h1>_h _<a href="#_h%20_"></a></h1>
<h1>_h _<a href="#h-_"></a></h1>
<h1>_h _<a href="#h__"></a></h1>

On a side note: in the third tag md2html opened an <em> tag without closing it. I guess that's expected since MD4C doesn't validate by design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions