🐛 `MarkdownViewer` incorrectly parses task items in `1. - [ ]` format
This issue was originally reported as https://github.com/github/memex/issues/11844
When a Markdown task list has items delimited with both a number and a dash or asterisk, the MarkdownViewer component fails to recognize the items and thus incorrectly checks the wrong list items:
https://user-images.githubusercontent.com/1062491/188623750-56d3a607-b7f5-4b2f-b8be-233a85e96bc5.mov
This is a draft component and a pretty uncommon edge case so I wouldn't prioritize this at the moment unless we start seeing more reports.
The problem is the list-item parsing regular expression:
https://github.com/primer/react/blob/679e699d2fa864a505251e07b0c2dd19ed4ad231/src/drafts/MarkdownEditor/_useListEditing.ts#L32
The ([*-]|(\d+)\.) group assumes that a list item will start with a bullet (- or *) or a number (1.). These list items start with a number and a bullet. I'm surprised the Markdown pipeline renders this list at all, but because it does, we should probably handle this case.
A note from our FR from the original issue:
I couldn't replicate this outside of the non-standard edgecase of
1. - [ ]prefixed items, which seemed unconventional.
Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.