Closed jornvandebeek closed 11 years ago
On the other hand, whatever is being used to process GFM in this comment, correctly processes markedown inside spans, see below
This example shows a bullet list:
Fixed on master.
I believe the fix is not (completely) correct.
<span>*hello*</span>
<p><span>*hello*</span></p>
should be parsed as
<p><span><em>hello</em></span></p>
<p><span>*hello*</span></p>
which is not what Maruku trunk does. There's a (partial?) fix on my branch. But I don't think it handles Markdown inside of nested span-level elements as Gruber intends (?).
@distler you're absolutely right. Testing other engines, it looks like the rule is that if there's a bare HTML element, and it's a block element, then nothing should be parsed within it. If it's HTML within Markdown, or a bare HTML element that's a span element, then it does get Markdown parsed within it.
I'll reopen this, add some tests, and fix the logic.
As is frequently the case, the intended behaviour is not entirely clear.
<span>*hello*</span>
<p><span>*hello*</span></p>
<span>**hello** <span>*goodbye*</span></span>
It's pretty unambiguous that the first two should be parsed as
<p><span><em>hello</em></span></p>
<p><span>*hello*</span></p>
It's not entirely clear how the 3rd one is supposed to be parsed, but "most" Markdown interpreters seem to parse it as
<p><span><strong>hello</strong> <span><em>goodbye</em></span></span></p>
whereas my implementation (currently) treats it as
<p><span><strong>hello</strong> <span>*goodbye*</span></span></p>
I wrote:
There's a (partial?) fix on my branch. But I don't think it handles Markdown inside of nested span-level elements as Gruber intends (?).
Fixed properly, now.
Fixed in your branch? Let me know if you need a hand to bring the changes over here in a PR.
Fix is now on trunk.
The markdown spec specifies "Unlike block-level HTML tags, Markdown syntax is processed within span-level tags.", yet maruku does not adhere to this rule. Any markdown within html tags seems to be ignored:
Generates:
Edit:Added code tags