Skip to content

Another bug in parsing of headers #526

Closed

Description

@eGavr

I have such md-file

# ##

I've received the tokens of the given markdown by method marked.lexer:

[ { type: 'heading', depth: 1, text: '#' }, links: {} ]

But the given markdown does not have any headers.

Activity

  1. joshbruce commented on Dec 25, 2017

    @joshbruce
    Member

    See #981

  2. joshbruce commented on Jan 10, 2018

    @joshbruce
    Member

    See Commonmark observation from @Feder1co5oave in #981

  3. added
    L2 - annoying
    on Jan 10, 2018
  4. calculuschild commented on May 27, 2021

    @calculuschild
    Contributor

    Commonmark Example 49 seems to indicate that emitting an empty header is the correct behavior, and Example 42 tells us that the number of opening and closing # do not need to match.

    Our tests pass both of these Commonmark cases, and the OP's example correctly emits an empty header.

    @UziTech I think can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 - annoyingcategory: headingsparser: CommonMark

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions