quantizor / markdown-to-jsx

🏭 The most lightweight, customizable React markdown component.
https://markdown-to-jsx.quantizor.dev/
MIT License
1.96k stars 169 forks source link

Error using divider with `---` #581

Open oliveirarafa opened 3 months ago

oliveirarafa commented 3 months ago

I'm using frontmatter in my Markdown and using dividers (---) within my text. However, the library is removing all the text between the --- tags.

I noticed there's a pull request (https://github.com/quantizor/markdown-to-jsx/pull/538) that automatically removes YAML frontmatter. I suspect this PR is causing the issue by removing all text between --- tags, and since my text contains two such dividers, it gets removed.

Using another type of divider tag (like *** or ___) works correctly.

varnerac commented 3 weeks ago

I may be able to fix this by modifying the regex to be lazy while looking for ---. I'll try to take a look this week.