erusev/parsedown ? reverse-engineered prompt
Reverse engineered prompt
Build me a fast, simple Markdown parser in PHP that works in one file with no dependencies. I want it to turn Markdown into HTML, including headings, lists, links, emphasis, code, quotes, and basic GitHub style Markdown, and I also want a way to parse just a single line of Markdown when needed.
Please make it easy to drop into an existing project, and include a few clear examples showing how to use it. It should be reasonably safe with untrusted input too, so add an option to escape or sanitize HTML and protect against common XSS issues in links and other generated output.
If it helps, look up the current CommonMark and PHP best practices online, then keep the implementation clean and well tested. Also include a small test suite so I can verify the parser works correctly.
Are you gonna build this?
make sure you review the code using coderabbit