r93927 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93926‎ | r93927 | r93928 >
Date:22:21, 4 August 2011
Author:inez
Status:deferred
Tags:
Comment:
Fix couple more bugs/edge cases for wikidom generation. And delete 'annotations' from output if empty.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Content.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Content.js
@@ -592,7 +592,7 @@
593593 ? es.Content.htmlCharacters[right[0]] : right[0];
594594 left = right;
595595 }
596 - if ( !rightPlain ) {
 596+ if ( right ) {
597597 for ( j = 1; j < right.length; j++ ) {
598598 out += es.Content.renderAnnotation( 'close', right[j], stack );
599599 }
@@ -673,6 +673,14 @@
674674 leftPlain = typeof left === 'string';
675675 rightPlain = typeof right === 'string';
676676 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+ }
677685 lines.push(line);
678686 line = null;
679687 offset = i + 1;
@@ -711,7 +719,10 @@
712720 this.handleAnnotation( 'close', right[j], line.annotations, i - offset );
713721 }
714722 }
715 - lines.push(line);
 723+ if ( !line.annotations.length ) {
 724+ delete line.annotations;
 725+ }
 726+ lines.push( line );
716727 }
717728 return lines;
718729 };

Status & tagging log