evilstreak / markdown-js

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

Make markdown.js work with IE8 #68

Closed tatsuhiro-t closed 11 years ago

tatsuhiro-t commented 11 years ago

IE8's Array.prototype.splice requires 2nd argument to specify the number of elements to be removed. Without that, nothing is removed.

If JS compressor (e.g., yui) compresses markdown.js,

... function Markdown(dialect) {

will become something like:

... function g(d) { ...

Then, Markdown.dialects.Gruber becomes g.dialects.Gruber. But IE8 does not understand this. The fix is just remove "Markdown" from after "function".