Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | */ |
185 | 185 | var text = this.content.substring(); |
186 | 186 | // Purge "boundaries" and "words" arrays |
187 | | - this.boundaries = []; |
| 187 | + this.boundaries = [0]; |
188 | 188 | // Reset RegExp object's state |
189 | 189 | this.boundaryTest.lastIndex = 0; |
190 | 190 | // Iterate over each word+boundary sequence, capturing offsets and encoding text as we go |
— | — | @@ -268,7 +268,7 @@ |
269 | 269 | wordOffset, length, ruler, width - charFit.width |
270 | 270 | ); |
271 | 271 | if ( wordFit.end > wordOffset ) { |
272 | | - wordOffset = wordFit.end - 1; |
| 272 | + wordOffset = wordFit.end; |
273 | 273 | charFit.end = lineEnd = this.boundaries[wordOffset]; |
274 | 274 | } |
275 | 275 | } |
— | — | @@ -277,12 +277,11 @@ |
278 | 278 | charOffset = charFit.end; |
279 | 279 | } while ( charOffset < lineEnd ); |
280 | 280 | } else { |
281 | | - wordOffset = wordFit.end - 1; |
| 281 | + wordOffset = wordFit.end; |
282 | 282 | lineEnd = this.boundaries[wordOffset]; |
283 | 283 | this.appendLine( lineStart, lineEnd ); |
284 | 284 | } |
285 | 285 | lineStart = lineEnd; |
286 | | - wordOffset++; |
287 | 286 | } |
288 | 287 | // Cleanup |
289 | 288 | $ruler.remove(); |