Index: trunk/extensions/wikidiff2/wikidiff2.cpp |
— | — | @@ -382,6 +382,11 @@ |
383 | 383 | breaks.insert(thaiBreakPositions.begin(), thaiBreakPositions.end()); |
384 | 384 | } |
385 | 385 | |
| 386 | + // Add a fake end-of-string character and have a break on it, so that the |
| 387 | + // last word gets added without special handling |
| 388 | + breaks.insert(charSizes.size()); |
| 389 | + charSizes += (char)0; |
| 390 | + |
386 | 391 | // Now make the word array by traversing the breaks set |
387 | 392 | p = text.begin(); |
388 | 393 | IntSet::iterator pBrk = breaks.begin(); |
— | — | @@ -393,11 +398,6 @@ |
394 | 399 | pBrk++; |
395 | 400 | } |
396 | 401 | |
397 | | - // Add a fake end-of-string character and have a break on it, so that the |
398 | | - // last word gets added without special handling |
399 | | - breaks.insert(charSizes.size()); |
400 | | - charSizes += (char)0; |
401 | | - |
402 | 402 | for (charIndex = 0; charIndex < charSizes.size(); p += charSizes[charIndex++]) { |
403 | 403 | // Assume all spaces are ASCII |
404 | 404 | if (isSpace(*p)) { |
Index: trunk/extensions/wikidiff2/tests/001.phpt |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | <td class="diff-context"></td> |
156 | 156 | </tr> |
157 | 157 | <tr> |
158 | | - <td class="diff-marker">-</td> |
| 158 | + <td class="diff-marker">−</td> |
159 | 159 | <td class="diff-deletedline"><div>kjahegwnygw</div></td> |
160 | 160 | <td colspan="2"> </td> |
161 | 161 | </tr> |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | <td class="diff-context"><div>a</div></td> |
173 | 173 | </tr> |
174 | 174 | <tr> |
175 | | - <td class="diff-marker">-</td> |
| 175 | + <td class="diff-marker">−</td> |
176 | 176 | <td class="diff-deletedline"><div>---line---</div></td> |
177 | 177 | <td colspan="2"> </td> |
178 | 178 | </tr> |
— | — | @@ -237,12 +237,12 @@ |
238 | 238 | <td class="diff-context"><div>a</div></td> |
239 | 239 | </tr> |
240 | 240 | <tr> |
241 | | - <td class="diff-marker">-</td> |
| 241 | + <td class="diff-marker">−</td> |
242 | 242 | <td class="diff-deletedline"><div>--line1--</div></td> |
243 | 243 | <td colspan="2"> </td> |
244 | 244 | </tr> |
245 | 245 | <tr> |
246 | | - <td class="diff-marker">-</td> |
| 246 | + <td class="diff-marker">−</td> |
247 | 247 | <td class="diff-deletedline"><div>--line2--</div></td> |
248 | 248 | <td colspan="2"> </td> |
249 | 249 | </tr> |
— | — | @@ -313,7 +313,7 @@ |
314 | 314 | <td class="diff-context"><div>== Shortest sequence in Y ==</div></td> |
315 | 315 | </tr> |
316 | 316 | <tr> |
317 | | - <td class="diff-marker">-</td> |
| 317 | + <td class="diff-marker">−</td> |
318 | 318 | <td class="diff-deletedline"><div>x1</div></td> |
319 | 319 | <td colspan="2"> </td> |
320 | 320 | </tr> |
— | — | @@ -342,17 +342,17 @@ |
343 | 343 | <td class="diff-context"><div>x1</div></td> |
344 | 344 | </tr> |
345 | 345 | <tr> |
346 | | - <td class="diff-marker">-</td> |
| 346 | + <td class="diff-marker">−</td> |
347 | 347 | <td class="diff-deletedline"><div>x2</div></td> |
348 | 348 | <td colspan="2"> </td> |
349 | 349 | </tr> |
350 | 350 | <tr> |
351 | | - <td class="diff-marker">-</td> |
| 351 | + <td class="diff-marker">−</td> |
352 | 352 | <td class="diff-deletedline"><div>x1</div></td> |
353 | 353 | <td colspan="2"> </td> |
354 | 354 | </tr> |
355 | 355 | <tr> |
356 | | - <td class="diff-marker">-</td> |
| 356 | + <td class="diff-marker">−</td> |
357 | 357 | <td class="diff-deletedline"><div>x2</div></td> |
358 | 358 | <td colspan="2"> </td> |
359 | 359 | </tr> |
— | — | @@ -385,14 +385,10 @@ |
386 | 386 | <td class="diff-context"><div>== Changed line ==</div></td> |
387 | 387 | </tr> |
388 | 388 | <tr> |
389 | | - <td class="diff-marker">-</td> |
390 | | - <td class="diff-deletedline"><div> |
391 | | -blah blah blah <span class="diffchange diffchange-inline">1</span> |
392 | | - </div></td> |
| 389 | + <td class="diff-marker">−</td> |
| 390 | + <td class="diff-deletedline"><div>blah blah blah <span class="diffchange diffchange-inline">1</span></div></td> |
393 | 391 | <td class="diff-marker">+</td> |
394 | | - <td class="diff-addedline"><div> |
395 | | -blah blah blah <span class="diffchange diffchange-inline">2</span> |
396 | | - </div></td> |
| 392 | + <td class="diff-addedline"><div>blah blah blah <span class="diffchange diffchange-inline">2</span></div></td> |
397 | 393 | </tr> |
398 | 394 | <tr> |
399 | 395 | <td class="diff-marker"> </td> |
Index: trunk/extensions/wikidiff2/tests/003.phpt |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | </tr> |
30 | 30 | <tr> |
31 | 31 | <td class="diff-marker">−</td> |
32 | | - <td class="diff-deletedline"><div>!!FUZZY!!Rajaa</div></td> |
| 32 | + <td class="diff-deletedline"><div><span class="diffchange diffchange-inline">!!FUZZY!!Rajaa</span></div></td> |
33 | 33 | <td class="diff-marker">+</td> |
34 | | - <td class="diff-addedline"><div>Rajaa</div></td> |
| 34 | + <td class="diff-addedline"><div><span class="diffchange diffchange-inline">Rajaa</span></div></td> |
35 | 35 | </tr> |