bhollis / maruku

A pure-Ruby Markdown-superset interpreter (Official Repo).
MIT License
500 stars 80 forks source link

Maruku can't handle Headers in comments #115

Closed Shikaga closed 10 years ago

Shikaga commented 10 years ago

If you create a comment with a header within it, Maruku breaks down.

Maruku tells you: +--------------------------------------------------------------------------- REXML cannot parse this block of HTML/XML: <!---
Header
------
-->

Interestingly, it will work fine if the header is denoted by just a single dash ("-")

distler commented 10 years ago

A known problem with REXML.

Nokogiri handles this just fine.

bhollis commented 10 years ago

Not a known issue to me - we have no test that shows this behavior. I'll add one.

distler commented 10 years ago

I guess you're new here (follow the links).

bhollis commented 10 years ago

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.

distler commented 10 years ago

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.

distler commented 10 years ago

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.

distler commented 10 years ago

In this case, however, one could argue that this isn't really a REXML bug. Nokogiri is being too generous.

bhollis commented 10 years ago

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 commented 10 years ago

Here, then, are some tests you may find useful.

bhollis commented 10 years ago

@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.

distler commented 10 years ago

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.)

Shikaga commented 10 years ago

Thanks for the quick turnaround. Hopefully this bug can be pulled upstream into Github Pages soon.

Thanks again!