Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Request #16774 Word boundaries are insufficient for inline differ
Submitted: 2009-11-10 10:04 UTC
From: arencambre Assigned:
Status: Open Package: Text_Diff (version 1.1.1)
PHP Version: 5.2.5 OS: Debian
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 41 + 15 = ?

 
 [2009-11-10 10:04 UTC] arencambre (Aren Cambre)
Description: ------------ The online diff utility has a terribly insufficient word boundary definition. Currently it only defines space and \n as word boundaries. This means any punctuation will be part of a word boundary. This can cause serious usability problems. I recommend altering lines 158 and 159 of PEAR/Text/Diff/Renderer/inline.php and dramatically expanding the characters that define word boundaries to include all common punctuation. Test script: --------------- Diff these lines: The quick cat jumped over the lazy fox, who was totally lazy and should be shot. The quick cat jumped over the lazy fox. Expected result: ---------------- The quick cat jumped over the lazy fox<del>, who was totally lazy and should be shot.</del>. This is a much more accurate and legible deletion since the result does not reconstruct the sentence structure. Actual result: -------------- The quick cat jumped over the lazy <del>fox, who was totally lazy and should be shot.</del><ins>fox.</ins> This renders terribly because the first half of the sentence is split by the part that was deleted.

Comments

 [2009-11-10 16:19 UTC] yunosh (Jan Schneider)
-Type: Bug +Type: Feature/Change Request