arturadib / strapdown

Instant and elegant Markdown documents in the browser
http://strapdownjs.com
MIT License
2.48k stars 410 forks source link

Tables are not supported #12

Closed behrang closed 11 years ago

behrang commented 11 years ago

Marked documentation, states that it supports GFM tables. But when I place some table markdown like this:

 Header 1 | Header 2
 -------- | --------
 Cell 1   | Cell 2
 Cell 3   | Cell 4

it is not rendered as it is rendered on GitHub:

Header 1 Header 2
Cell 1 Cell 2
Cell 3 Cell 4

It just makes the first row an H2 tag.

arturadib commented 11 years ago

Markdown parsing is done via Marked - https://github.com/chjj/marked/

Please report the issue there. I'll close it for now but please reopen if you can confirm the issue is not present upstream.

behrang commented 11 years ago

I installed marked@0.2.7 and tested it using a nodejs script like this:

var marked = require('marked');

console.log(marked(
  " Header 1 | Header 2\n" +
  " -------- | --------\n" +
  " Cell 1   | Cell 2\n" +
  " Cell 3   | Cell 4"
));

This prints an HTML table correctly. So I think the problem is somewhere in strapdownjs.

Thanks

arturadib commented 11 years ago

thanks! can you please replace vendor/marked.min.js with the latest version and see if that fixes the problem for Strapdown?

behrang commented 11 years ago

I used the lib/marked.js version (not minified) and it worked! It converted the above input into a table.

arturadib commented 11 years ago

fixed in 509f99f9c00e6b40f208a39e2a2c980331642fe5

let me know if that does the trick, thanks

behrang commented 11 years ago

It's fixed. Thanks