[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/kopete/libkopete
From:       Casey Allen Shobe <cshobe () softhome ! net>
Date:       2004-05-21 8:27:42
Message-ID: 20040521082742.9B3971E47 () office ! kde ! org
[Download RAW message or body]

CVS commit by cshobe: 

Pointing out problems with Kopete's emoticon implementation, and providing lots of \
failing test cases.


  M +11 -0     private/kopeteemoticons.cpp   1.18
  M +8 -0      tests/kopeteemoticontest.cpp   1.3


--- kdenetwork/kopete/libkopete/private/kopeteemoticons.cpp  #1.17:1.18
@@ -262,4 +262,15 @@ QString KopeteEmoticons::parseEmoticons(
                                 QString::fromLatin1( "\" title=\"" ) + escaped +
                                 QString::fromLatin1( "\"/>" ) );
+                        // FIXME: It would seem to me a more correct way of doing \
things +                        // would be to only analyze non-special fields.  Any \
special field +                        // should be pre-escaped and not considered in \
emoticon parsing. +                        // Such fields include: URLs, Contact IDs, \
Display Aliases, +                        // Metacontact names, Status/system \
messages, HTML tags/entities. +                        // - Casey
+
+                        // FIXME: I would say that every emoticon should have a
+                        // beginning-of-line, end-of-line, or whitespace character \
(space, +                        // tab, &nbsp;) on at least one side of the \
emoticon.  No +                        // surrounding whitespace/eol/bol - no \
emoticon.  - Casey  }
         }

--- kdenetwork/kopete/libkopete/tests/kopeteemoticontest.cpp  #1.2:1.3
@@ -69,4 +69,12 @@ static TestSet knownBroken =
         { "In a sentence:practical example", "In a sentence:practical example" },
         { "Bla (&nbsp;)", "Bla (&nbsp;)" },
+        { ":D and :-D are not the same as :d and :-d", "<img align=\"center\" \
width=\"20\" height=\"20\" src=\"teeth.png\" title=\":D\"/> and <img align=\"center\" \
width=\"20\" height=\"20\" src=\"teeth.png\" title=\":-D\"/> are not the same as :d \
and :-d" }, +        // A future emoticon theme may very well have an emoticon for \
:d/:-d (an +        // upward tongue expression - Casey
+        { "4d:D>:)F:/&gt;:-(:Pu:d9", "4d:D>:)F:/&gt;:-(:Pu:d9" },
+        { "&lt;::pvar:: test=1&gt;", "&lt;::pvar:: test=1&gt;" },
+        { "a non-breaking space (&nbsp;) character", "a non-breaking space (&nbsp;) \
character" }, +        { "-+-[-:-(-:-)-:-]-+-", "-+-[-:-(-:-)-:-]-+-" },
+        { "::shrugs::", "::shrugs::" },
         { NULL, NULL }
 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic