mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
A bare list marker followed only by a space (e.g. `- ` or `1. `) was not recognized as a list and fell through to a paragraph, so `- ` rendered as `<p>- </p>` instead of an empty list item. A marker with no trailing space (`-`, `1.`) and an empty item that continues an existing list were already handled correctly, making the behavior inconsistent. The block `list` rule required content after the marker's whitespace (`[ \t][^\n]+?`), so a marker followed only by whitespace failed to match. Relax it to `[ \t][^\n]*?` so a marker with trailing whitespace and no content still starts a list, matching the CommonMark reference and markdown-it. To keep CommonMark's rule that an empty list item cannot interrupt a paragraph, the paragraph list-interrupt patterns now require a non-blank character after the marker, so `foo\n+ ` stays a single paragraph while `foo\n- bar` still interrupts.