bhollis / maruku

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

Maruku confused by HTML that contains @ signs #83

Closed kentonv closed 11 years ago

kentonv commented 11 years ago

The following command will cause Maruku to spew errors:

echo -e '<div><span>@Foo</span>\n\n</div>' | maruku

If you remove the @ sign, it works correctly. In general, raw HTML containing @ signs seems to confuse Maruku, with some cases of this confusion causing more trouble than others.

Replacing the @ with an HTML entity would be a work-around, but in my use case (highlighted code blocks in Jekyll) I do not have the ability to control Maruku's input so precisely.

I appear to be using version 0.6.1.

distler commented 11 years ago

The problem (in 0.6.1) isn''t the '@' sign, it's the blank lines. That is

echo -e  '<div><span>@Foo</span></div>'  | maruku

works fine in 0.6.1.

Either way, this is fixed on trunk.

kentonv commented 11 years ago

Well, removing the blank lines "fixes" the problem, but removing the @ sign also "fixes" the problem, and removing the <span></span> tags is yet another way to "fix" the problem. I blamed the @ because it's the one component that most clearly shouldn't have any effect on the parsing. :)

Anyway, glad to hear it's fixed. I notice the build status is failing. Is it safe to use?

distler commented 11 years ago

Anyway, glad to hear it's fixed. I notice the build status is failing. Is it safe to use?

As far as I understand, there are issues with Nokogiri on JRuby. If you're not using JRuby, you should have no problem.

distler commented 11 years ago

I wrote;

The problem (in 0.6.1) isn''t the '@' sign, it's the blank lines. That is

echo -e  '<div><span>@Foo</span></div>'  | maruku

works fine in 0.6.1.

N.B.: 0.6.1's output is incorrect; all I meant is that it does produce output (rather than an error message).

kentonv commented 11 years ago

Right, because for whatever reason the @ makes 0.6.1 treat the line as plain text rather than HTML. Remove the @ and the output is correct.

Anyway, confirmed fixed in trunk.