r90566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90565‎ | r90566 | r90567 >
Date:00:44, 22 June 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed off-by-1 error, causing words to disappear sometimes.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -30,7 +30,7 @@
3131
3232 // Build list of line break offsets
3333 var words = [0],
34 - boundary = /[ \-\t\r\n\f]/,
 34+ boundary = /[ \.\,\;\:\-\t\r\n\f]/,
3535 left = 0,
3636 right = 0,
3737 search = 0;
@@ -46,7 +46,7 @@
4747 var pos = 0,
4848 index = 0,
4949 metrics = [];
50 - while ( pos < words.length - 1 ) {
 50+ while ( pos < words.length ) {
5151 // Create line
5252 var $line = $( '<div class="editSurface-line"></div>' )
5353 .attr( 'line-index', index )
@@ -81,7 +81,7 @@
8282
8383 // Step forward
8484 index++;
85 - pos = m;
 85+ pos = l;
8686 }
8787
8888 //console.timeEnd( 'TextFlow.render' );

Status & tagging log