Maruku can't handle Headers in comments
Closed this issue · 12 comments
If you create a comment with a header within it, Maruku breaks down.
| Maruku tells you:
+---------------------------------------------------------------------------
| REXML cannot parse this block of HTML/XML:
| |
Interestingly, it will work fine if the header is denoted by just a single dash ("-")
A known problem with REXML.
Nokogiri handles this just fine.
Not a known issue to me - we have no test that shows this behavior. I'll add one.
Yeah, I haven't read your blog. Anything not checked in as a pending test is officially not a "known issue" to the Maruku project.
REXML, at least circa 2008 when that blog post was written, was notoriously buggy. That's why I decided to switch my branch of Maruku (and all my other projects) to Nokogiri.
I haven't kept track of which REXML bugs have been fixed in the interim. Evidently, there are a few remaining.
Whatever REXML bugs remain, I wouldn't expect them to be tracked as "known issues" in Maruku.
I haven't kept track of which REXML bugs have been fixed in the interim.
Actually, it appears that nothing has changed since then. Sam Ruby (my interlocutor in that blog post) went on a tear, submitting REXML patches, shortly after that blog post was written. Since then ... nothing. Any bugs that Sam didn't fix in 2008 are still unfixed.
In this case, however, one could argue that this isn't really a REXML bug. Nokogiri is being too generous.
You may opt in to the Nokogiri-based XML parsing by setting :html_parser => 'nokogiri'
. However, I will continue to work around bugs in REXML as long as it is the default XML parser that ships with Ruby.
@distler, please file PRs when you fix bugs like this - it's no fun to spend time fixing them just to find out they've already been fixed on your fork.
I didn't submit a PR because I didn't think that what I had done fixed the problem under REXML. (It works under Nokogiri, which is all that I cared about.)
Thanks for the quick turnaround. Hopefully this bug can be pulled upstream into Github Pages soon.
Thanks again!