Skip to content

Commit 98d99c8

Browse files
committed
Merge pull request evilstreak#68 from tatsuhiro-t/master
Make markdown.js work with IE8
2 parents d5b4573 + 8bcb2ac commit 98d99c8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/markdown.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*
3333
* [JsonML]: http://jsonml.org/ "JSON Markup Language"
3434
**/
35-
var Markdown = expose.Markdown = function Markdown(dialect) {
35+
var Markdown = expose.Markdown = function(dialect) {
3636
switch (typeof dialect) {
3737
case "undefined":
3838
this.dialect = Markdown.dialects.Gruber;
@@ -495,11 +495,11 @@ Markdown.dialects.Gruber = {
495495
if (i+1 == stack.length) {
496496
// Last stack frame
497497
// Keep the same array, but replace the contents
498-
last_li.push( ["para"].concat( last_li.splice(1) ) );
498+
last_li.push( ["para"].concat( last_li.splice(1, last_li.length - 1) ) );
499499
}
500500
else {
501501
var sublist = last_li.pop();
502-
last_li.push( ["para"].concat( last_li.splice(1) ), sublist );
502+
last_li.push( ["para"].concat( last_li.splice(1, last_li.length - 1) ), sublist );
503503
}
504504
}
505505

@@ -576,7 +576,7 @@ Markdown.dialects.Gruber = {
576576
for (i = 0; i < stack.length; i++) {
577577
if ( stack[ i ].indent != m[1] ) continue;
578578
list = stack[ i ].list;
579-
stack.splice( i+1 );
579+
stack.splice( i+1, stack.length - (i+1) );
580580
found = true;
581581
break;
582582
}
@@ -585,7 +585,7 @@ Markdown.dialects.Gruber = {
585585
//print("not found. l:", uneval(l));
586586
wanted_depth++;
587587
if (wanted_depth <= stack.length) {
588-
stack.splice(wanted_depth);
588+
stack.splice(wanted_depth, stack.length - wanted_depth);
589589
//print("Desired depth now", wanted_depth, "stack:", stack.length);
590590
list = stack[wanted_depth-1].list;
591591
//print("list:", uneval(list) );
@@ -1513,7 +1513,7 @@ function convert_tree_to_html( tree, references, options ) {
15131513
jsonml[ 0 ] = "pre";
15141514
i = attrs ? 2 : 1;
15151515
var code = [ "code" ];
1516-
code.push.apply( code, jsonml.splice( i ) );
1516+
code.push.apply( code, jsonml.splice( i, jsonml.length - i ) );
15171517
jsonml[ i ] = code;
15181518
break;
15191519
case "inlinecode":

0 commit comments

Comments
 (0)