evilstreak / markdown-js

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

Code blocks being detected as inline code #223

Closed skhavari closed 9 years ago

skhavari commented 9 years ago

repro: convert the following markdown text with gruber

var x = new Date();

expect: the output to be a preformatted code block

var x = new Date();

actual: parser detects input as inline code and is outputting the following

js var x = new Date();

jaredatron commented 9 years ago

+1 Also being able to register parsers for each kind of code block would be awesome

codingisacopingstrategy commented 9 years ago

Hello!

I don’t think the ```` code-block syntax is in the Gruber dialect? Gruber uses backticks for inline code elements, and you can use backticks as deliminators in case you want to use single backticks in the code. The output generated by markdown.js matches http://daringfireball.net/projects/markdown/dingus in this case.

Best,

ashb commented 9 years ago

Fenced code blocks are from Github Flavoured Markdown (and probably a few others) which has been started but needs more work in #41