32
32
*
33
33
* [JsonML]: http://jsonml.org/ "JSON Markup Language"
34
34
**/
35
- var Markdown = expose . Markdown = function Markdown ( dialect ) {
35
+ var Markdown = expose . Markdown = function ( dialect ) {
36
36
switch ( typeof dialect ) {
37
37
case "undefined" :
38
38
this . dialect = Markdown . dialects . Gruber ;
@@ -495,11 +495,11 @@ Markdown.dialects.Gruber = {
495
495
if ( i + 1 == stack . length ) {
496
496
// Last stack frame
497
497
// 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 ) ) ) ;
499
499
}
500
500
else {
501
501
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 ) ;
503
503
}
504
504
}
505
505
@@ -576,7 +576,7 @@ Markdown.dialects.Gruber = {
576
576
for ( i = 0 ; i < stack . length ; i ++ ) {
577
577
if ( stack [ i ] . indent != m [ 1 ] ) continue ;
578
578
list = stack [ i ] . list ;
579
- stack . splice ( i + 1 ) ;
579
+ stack . splice ( i + 1 , stack . length - ( i + 1 ) ) ;
580
580
found = true ;
581
581
break ;
582
582
}
@@ -585,7 +585,7 @@ Markdown.dialects.Gruber = {
585
585
//print("not found. l:", uneval(l));
586
586
wanted_depth ++ ;
587
587
if ( wanted_depth <= stack . length ) {
588
- stack . splice ( wanted_depth ) ;
588
+ stack . splice ( wanted_depth , stack . length - wanted_depth ) ;
589
589
//print("Desired depth now", wanted_depth, "stack:", stack.length);
590
590
list = stack [ wanted_depth - 1 ] . list ;
591
591
//print("list:", uneval(list) );
@@ -1513,7 +1513,7 @@ function convert_tree_to_html( tree, references, options ) {
1513
1513
jsonml [ 0 ] = "pre" ;
1514
1514
i = attrs ? 2 : 1 ;
1515
1515
var code = [ "code" ] ;
1516
- code . push . apply ( code , jsonml . splice ( i ) ) ;
1516
+ code . push . apply ( code , jsonml . splice ( i , jsonml . length - i ) ) ;
1517
1517
jsonml [ i ] = code ;
1518
1518
break ;
1519
1519
case "inlinecode" :
0 commit comments