I remember seeing this on /r/PHP, and one of the top comments there was about it using Regex instead of parsing it like a language. However, I also recall that it's thanks to using regex that it works so quickly. So I figured I'd get this argument out of the way before someone else brought it up.
Show HN: Fast and Extensible Parser for Markdown in PHP
11–20 of 39 posts
Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#12Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#13Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#14I've worked with several markdown implementations and parsedown is my current choice due to my main constraint - speed. Great work and thanks for sharing.
Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#15Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#16If the second empty line marks the end of the list block, the indented html (code block) should preserve tags
Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#17I remember seeing this on /r/PHP, and one of the top comments there was about it using Regex instead of parsing it like a language. However, I also recall that it's thanks to using regex that it works so quickly. So I figured I'd get this argument out of the way before someone else brought it up.
From having tilted at this windmill a little myself, I think:
1. It's tricky enough to handle correctly all the under-specified corner cases of basic markdown -- not to mention the popular extensions to it. The cognitive load of doing it with complex regexps gets heavy, quickly.
2. I'm incredibly impressed with all the work that John MacFarlane has put into the problem, for example in [Pandoc] and [Cheapskate].
[Pandoc]: https://github.com/jgm/pandoc
[Cheapskate]: https://github.com/jgm/cheapskate
Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#18Parsedown is certainly very fast, but I wouldn't call it "extensible". CeBe's markdown parser is nearly as fast, but focusses on being very easy to extend, so it's trivial to add custom syntax elements, see https://github.com/cebe/markdown (CeBe's library is inspired by parsedown)
> Parsedown is certainly very fast, but I wouldn't call it "extensible". Parsedown is extensible and it already has been extended. There's a well working extension of Parsedown that adds support for Markdown Extra. It's called Parsedown Extra. It can be found at https://github.com/erusev/parsedown-extra
Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#19Different markdown editors seem to be in disagreement how to parse the following: https://gist.github.com/anonymous/810ae1f7d52bcfffa1ef If the second empty line marks the end of the list block, the indented html (code block) should preserve tags
Re: Show HN: Fast and Extensible Parser for Markdown in PHP
#20It's important to remember that most markdown implementations (including his one) cannot be used to provide a safe mechanism for authoring user generated content without opening a site up to XSS vulnerabilities, since markdown allows arbritrary HTML markup.