Bug 69964 - The ":/" part of "http://" in URL's are replaced with smileys
Summary: The ":/" part of "http://" in URL's are replaced with smileys
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: libkopete (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-09 23:45 UTC by Dik Takken
Modified: 2004-02-13 22:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dik Takken 2003-12-09 23:45:33 UTC
Version:            (using KDE KDE 3.1.94)
Installed from:    Compiled From Sources
OS:          Linux

It seems that Kopete tries to identify smileys in text before it tries to find URL's.
Comment 1 Olivier Goffart 2003-12-10 14:16:40 UTC
This is yet another bad behavior of our new emoticon parsing aloritm.
(the one which parse EVERY occurence of an emoticon string with the emoticon)

for rappel: The previous algoritm only remplaced if there were preceded and followed by spaces or separators  (word boundary?). 
It has been changed just because a suite of emoticons was not parsed correctly ( :-D:-D:-D:-D )


Again, i'm all for the old algoritm.
Comment 2 Dik Takken 2003-12-10 14:21:29 UTC
Is it not possible to have the emoticon parser simply skip URL's? I assume you parse messages in multiple passes. If you mark URL's during the first pass, you can easily skip them when you look for emoticons in the second pass. 
Comment 3 Jason Keirstead 2003-12-10 14:24:56 UTC
Subject: Re: [Kopete-devel]  The ":/" part of "http://" in URL's are replaced with smileys

Hrnm, why can't we just do the link replacement after the emotiocon parsing 
instead of before it?

And add :// as a parsing exemption in the emotiocon regex

Comment 4 Olivier Goffart 2003-12-10 14:32:33 UTC
> Is it not possible to have the emoticon parser simply skip URL's? 

It could be possible, but not as easy as that.
The message is and stay an HTML string, so the url is simply inbetween <a ...> and </a> 
There is already some regexp to don't remplace emoticons IN the tag (i.e: the href), and it would be much more difficult to search for more and more negative case.

Comment 5 Olivier Goffart 2003-12-10 14:34:59 UTC
> why can't we just do the link replacement after the emotiocon parsing

will be even worse, since even the href="" will be corrupted

Comment 6 Jason Keirstead 2003-12-10 14:40:22 UTC
Subject: Re: [Kopete-devel]  The ":/" part of "http://" in URL's are replaced with smileys

On December 10, 2003 9:34 am, Olivier Goffart wrote:
> > why can't we just do the link replacement after the emotiocon parsing

> will be even worse, since even the href="" will be corrupted

No it won't, the emotiocon regex does not replace anything inside HTML
tags. (<>)

The part linked to would be though. As in, it would be like:

<a href="http://foo.bar">http(Smile)/foo.bar</a>

...which is why I said we should also add an exemption for ://

Comment 7 Jason Keirstead 2004-01-09 23:32:27 UTC
This is fixed in CVS from what I can see
Comment 8 Olivier Goffart 2004-01-10 18:07:21 UTC
> This is fixed in CVS from what I can see 

No it's not, maybe you don't have a  :/  emoticon
Comment 9 Dik Takken 2004-01-20 14:45:54 UTC
I just compiled KDE 3.2 RC1 and everything seems to work perfectly. But I also discovered that the :/ emoticon is gone. Which emoticon set contains the :/, I would like to test this.
Comment 10 Florian Loitsch 2004-01-20 22:04:52 UTC
i'm using the "boxed" emoticons. (and kde 3.2 RC1)
Comment 11 Dik Takken 2004-01-20 23:51:55 UTC
Using the boxed set, I can see that the problem is still there in 3.2 RC1. 

Comment 12 Christian Loitsch 2004-01-26 22:56:25 UTC
I don't think that making a special case for :/ is a good idea.  Even though I can't find an example right now, it might be possible (maybe when new emoticons are added), that parts of an url contain them as well.  For instance 8-P is a candidate for this.  Adding other protocols (like edonkey-links,...) could make this problem reappear as well.
Comment 13 Stefan Gehn 2004-02-12 12:42:29 UTC
Maybe we can just omit the "magic url string" '://' inside the regexp?
Comment 14 Martijn Klingens 2004-02-13 22:17:19 UTC
CVS commit by mklingens: 

Forward port the fix for the ':/' in URIs gets replaced by an emoticon
bug and the associated changes to the regression test.

CCMAIL: 69964-done@bugs.kde.org


  M +34 -36    private/kopeteemoticons.cpp   1.17
  M +10 -7     tests/kopeteemoticontest.cpp   1.2