Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GFM: single-- setext underline that could be an empty list item is parsed as H2 #1107

@kkohbrok

Description

@kkohbrok

Hi folks and first of all thanks for maintaining this crate!

We're using it to parse GitHub flavored markdown and stumbled on one of the spots where CommonMark and GFM disagree. CommonMark example 96 explicitly renders Foo\n- as <h2>Foo</h2>, but GFM §4.3 Setext headings says (emphasis mine):

A setext heading underline is a sequence of = characters or a sequence of - characters, with no more than 3 spaces indentation and any number of trailing spaces. If a line containing a single - can be interpreted as an empty list item, it should be interpreted this way and not as a setext heading underline.

Unsurprisingly, this crate is CommonMark compliant. However, I was wondering if you'd be willing to support GFM behaviour gated by Options::ENABLE_GFM.

If you're generally positive towards this change, I'd be happy to take a stab at a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions