Skip to content

Blank lines in lists #78

@rlidwka

Description

@rlidwka

Quoting spec here:

A list item can begin with at most one blank line. In the following example, foo is not part of the list item:

-

  foo

So foo shouldn't be part of the list, and I was able to verify that it indeed isn't:

$ echo -e '-\n\n  foo' | ./commonmark.js/bin/commonmark
<ul>
<li></li>
</ul>
<p>foo</p>

However, adding a couple of spaces to each line makes it so commonmark.js doesn't seem to consider those lines blank anymore:

$ echo -e '-  \n  \n  foo' | ./commonmark.js/bin/commonmark 
<ul>
<li>foo</li>
</ul>

Which is probably a bug here, since a line that consists entirely of whitespaces is still considered a blank line according to spec.

cmark parses this correctly:

$ echo -e '-  \n  \n  foo' | ./cmark/build/src/cmark 
<ul>
<li></li>
</ul>
<p>foo</p>

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