Skip to content

Fails to match lists with spaces between lines (as ChatGPT tends to generate in its markdown lists) #36

@ailabs-software

Description

@ailabs-software

Hey there,

I found a bug where it fails to match lists with extra newlines (double spacing) between lines (as ChatGPT tends to generate in its markdown lists).

For example:

1. violin

2. piano

The fix is to change your listR regex to add a + after \n in the first group:
(?:(^|\n+)([+-]|\d+.) +(.(\n[ \t]+.)*))+

I'm not positive this doesn't break something else, but has worked for my use and I haven't found anything it breaks.

Not sure if you want to change it at this point, but thought I'd let you know.

I found this bug whilst porting your library to Dart because I needed a markdown parser that didn't add hundreds of kilobytes of JavaScript. Not a bad library for its size!

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