Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | this.boundaries = []; |
12 | 12 | this.lines = []; |
13 | 13 | this.width = null; |
14 | | - this.boundaryTest = /([ \.\,\;\:\-\t\r\n\f])/g; |
| 14 | + this.boundaryTest = /([ \-\t\r\n\f])/g; |
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
— | — | @@ -188,15 +188,12 @@ |
189 | 189 | this.boundaryTest.lastIndex = 0; |
190 | 190 | // Iterate over each word+boundary sequence, capturing offsets and encoding text as we go |
191 | 191 | var match, |
192 | | - start = 0, |
193 | 192 | end; |
194 | 193 | while ( match = this.boundaryTest.exec( text ) ) { |
195 | 194 | // Include the boundary character in the range |
196 | 195 | end = match.index + 1; |
197 | 196 | // Store the boundary offset |
198 | 197 | this.boundaries.push( end ); |
199 | | - // Remember the previous match |
200 | | - start = end; |
201 | 198 | } |
202 | 199 | // If the last character is not a boundary character, we need to append the final range to the |
203 | 200 | // "boundaries" and "words" arrays |
— | — | @@ -250,10 +247,10 @@ |
251 | 248 | wordFit, |
252 | 249 | charOffset, |
253 | 250 | charFit, |
254 | | - length = this.content.getLength(), |
| 251 | + wordCount = this.boundaries.length, |
255 | 252 | ruler = $ruler.addClass('editSurface-line')[0]; |
256 | | - while ( wordOffset < this.boundaries.length ) { |
257 | | - wordFit = this.fitWords( wordOffset, length, ruler, width ); |
| 253 | + while ( wordOffset < wordCount - 1 ) { |
| 254 | + wordFit = this.fitWords( wordOffset, wordCount - 1, ruler, width ); |
258 | 255 | if ( wordFit.width > width ) { |
259 | 256 | // The first word didn't fit, we need to split it up |
260 | 257 | charOffset = lineStart; |
— | — | @@ -265,7 +262,7 @@ |
266 | 263 | if (charFit.end === lineEnd) { |
267 | 264 | // Try to fit more words on the line |
268 | 265 | wordFit = this.fitWords( |
269 | | - wordOffset, length, ruler, width - charFit.width |
| 266 | + wordOffset, wordCount - 1, ruler, width - charFit.width |
270 | 267 | ); |
271 | 268 | if ( wordFit.end > wordOffset ) { |
272 | 269 | wordOffset = wordFit.end; |