evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

Inline Maruku attribute lists don't seem to work #186

Open aendra-rininsland opened 10 years ago

aendra-rininsland commented 10 years ago

According to the Maruku metadata proposal, the following:

### Header ###     {: #myid}

...Should translate to:

<h3 id="myid">Header</h3>

However:

markdown.toHTML('### Header ###     {: #myid}', 'Maruku');

...Instead yields:

"<h3>Header ###     {: #myid}</h3>"

...Leading me to believe something's broken in 0.6.0-beta1.

Worth noting that adding a newline before the metadata makes everything work swimmingly.

aendra-rininsland commented 10 years ago

Experimenting with it a bit more, images, links and other inline content requires that the metadata block be right next to the element, without any whitespace. You in fact need to do this, or else the metadata will get applied to the next paragraph.

Even if the implementation is left as-is, there really needs to be some documentation about it.

ashb commented 10 years ago

Okay yes one of two things need fixing there.

Form what I remember of the maruku docs properties for block level elements (i.e. the h3) need to be the line below the element.

Could you work out how the official ruby maruku gem behaves for these cases please?

ashb commented 10 years ago

Oh header is right there in the example - yeah so that looks like a bug then.