r91920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91919‎ | r91920 | r91921 >
Date:22:42, 11 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed flow problems.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -183,7 +183,7 @@
184184 */
185185 var text = this.content.substring();
186186 // Purge "boundaries" and "words" arrays
187 - this.boundaries = [];
 187+ this.boundaries = [0];
188188 // Reset RegExp object's state
189189 this.boundaryTest.lastIndex = 0;
190190 // Iterate over each word+boundary sequence, capturing offsets and encoding text as we go
@@ -268,7 +268,7 @@
269269 wordOffset, length, ruler, width - charFit.width
270270 );
271271 if ( wordFit.end > wordOffset ) {
272 - wordOffset = wordFit.end - 1;
 272+ wordOffset = wordFit.end;
273273 charFit.end = lineEnd = this.boundaries[wordOffset];
274274 }
275275 }
@@ -277,12 +277,11 @@
278278 charOffset = charFit.end;
279279 } while ( charOffset < lineEnd );
280280 } else {
281 - wordOffset = wordFit.end - 1;
 281+ wordOffset = wordFit.end;
282282 lineEnd = this.boundaries[wordOffset];
283283 this.appendLine( lineStart, lineEnd );
284284 }
285285 lineStart = lineEnd;
286 - wordOffset++;
287286 }
288287 // Cleanup
289288 $ruler.remove();

Status & tagging log