Skip to content

Parses Jekyll-style metadata as a heading #342

@lamby

Description

@lamby

Jekyll (and similar, including Python-markdown) uses the following top-of-file metadata headers:

---
key: value
---
body

However, cmark parses this as a heading:

<hr />
<h2>key: value</h2>
<p>body</p>

Presumably because the --- underneath is the RestructuredText-style underscored headings. Indeed, a more-minimal testcase is actually:

a
-
b
<h2>a</h2>
<p>b</p>

… which I was expecting in a human sense to be parsed as:

<p>a</p>
<hr />
<p>b</p>

I'm not sure what the solution is here. Special-case the triple --- due to Jekyll's widespread use of this?

(I discovered this via https://github.com/wereturtle/ghostwriter/issues/518)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions