Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown syntax is not processed within span-level tags. #31

Closed
jornvandebeek opened this issue Feb 14, 2011 · 8 comments
Closed

Markdown syntax is not processed within span-level tags. #31

jornvandebeek opened this issue Feb 14, 2011 · 8 comments
Labels
Milestone

Comments

@jornvandebeek
Copy link

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:

Maruku.new("<span>*hello*</span>").to_html

Generates:

"<span>*hello*</span>"

Edit:Added code tags

@pelegri
Copy link

pelegri commented May 4, 2012

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:

  • One
  • Two

@bhollis
Copy link
Owner

bhollis commented Mar 4, 2013

Fixed on master.

@bhollis bhollis closed this as completed Mar 4, 2013
@distler
Copy link
Collaborator

distler commented Apr 18, 2013

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

@bhollis
Copy link
Owner

bhollis commented Apr 19, 2013

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

@bhollis bhollis reopened this Apr 19, 2013
@distler
Copy link
Collaborator

distler commented Apr 19, 2013

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>

@distler
Copy link
Collaborator

distler commented May 14, 2013

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.

@bhollis
Copy link
Owner

bhollis commented May 15, 2013

Fixed in your branch? Let me know if you need a hand to bring the changes over here in a PR.

@distler
Copy link
Collaborator

distler commented May 27, 2013

Fix is now on trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants