markdown-js icon indicating copy to clipboard operation
markdown-js copied to clipboard

Maruku dialect TypeError: Cannot read property 'splice' of undefined

Open aleray opened this issue 8 years ago • 1 comments

Hi,

the following snippet raises a TypeError: Cannot read property 'splice' of undefined error. Not sure about what is going on exactly. The markdown below is a minimal example from a more complex case that initially triggered the error. Even the source text looks terrible, would be nice if markdown-js could not break.

var markdown = require( "markdown" ).markdown;
md_content = 'Foo: Bar  \n{: style=" key: value; }'
html_content = markdown.toHTML( md_content, 'Maruku');

Thanks,

aleray avatar Sep 11 '15 10:09 aleray

Weirdly, this error seems to occur whenever the first word in a line ends with a colon.

"foo: bar  \n{: .aclass }"  // error
"foo : bar \n{: .aclass }" // no error
markdown.min.js:1 Uncaught TypeError: Cannot read property 'splice' of undefined
    at m.u.block.block_meta (markdown.min.js:1)
    at m.processBlock (markdown.min.js:1)
    at m.toTree (markdown.min.js:1)
    at Object.m.parse (markdown.min.js:1)

chadananda avatar Feb 18 '18 15:02 chadananda