Skip to content

[Markdown-Bug] - The previous paragraph is ignored mistakenly when the following ul "-" line has no text #2199

@JamesChenX

Description

@JamesChenX

Version: markdown-7.3.0

Reproducible code:

final doc = md.Document(
    extensionSet: markdownExtensionSet ?? md.ExtensionSet.gitHubFlavored,
    encodeHtml: false, // Allow HTML pass-through for richer content
    inlineSyntaxes: customInlineSyntaxes,
    blockSyntaxes: customBlockSyntaxes,
);

// astNodes1 has one element of `p`
final astNodes1 = doc.parse('A paragraph');

// ❌❌❌
// astNodes2 has one element of `ul` which has an empty `li` element without text
// while it should have two elements, one for the paragraph, another for the ul.
final astNodes2 = doc.parse('A paragraph\n- ');

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions