Index: trunk/parsers/wikidom/lib/es/es.Content.js |
— | — | @@ -592,7 +592,7 @@ |
593 | 593 | ? es.Content.htmlCharacters[right[0]] : right[0]; |
594 | 594 | left = right; |
595 | 595 | } |
596 | | - if ( !rightPlain ) { |
| 596 | + if ( right ) { |
597 | 597 | for ( j = 1; j < right.length; j++ ) { |
598 | 598 | out += es.Content.renderAnnotation( 'close', right[j], stack ); |
599 | 599 | } |
— | — | @@ -673,6 +673,14 @@ |
674 | 674 | leftPlain = typeof left === 'string'; |
675 | 675 | rightPlain = typeof right === 'string'; |
676 | 676 | if ( rightPlain && right == "\n" ) { |
| 677 | + if ( left ) { |
| 678 | + for ( j = 1; j < left.length; j++ ) { |
| 679 | + this.handleAnnotation( 'close', left[j], line.annotations, i - offset ); |
| 680 | + } |
| 681 | + } |
| 682 | + if ( !line.annotations.length ) { |
| 683 | + delete line.annotations; |
| 684 | + } |
677 | 685 | lines.push(line); |
678 | 686 | line = null; |
679 | 687 | offset = i + 1; |
— | — | @@ -711,7 +719,10 @@ |
712 | 720 | this.handleAnnotation( 'close', right[j], line.annotations, i - offset ); |
713 | 721 | } |
714 | 722 | } |
715 | | - lines.push(line); |
| 723 | + if ( !line.annotations.length ) { |
| 724 | + delete line.annotations; |
| 725 | + } |
| 726 | + lines.push( line ); |
716 | 727 | } |
717 | 728 | return lines; |
718 | 729 | }; |