Summary: | Links generated using only parts of URL | ||
---|---|---|---|
Product: | [Applications] kopete | Reporter: | Christian Nitschkowski <christian.nitschkowski> |
Component: | general | Assignee: | Kopete Developers <kopete-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 0.7.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Christian Nitschkowski
2003-08-14 23:52:02 UTC
this seems more like a wishlist bug to me, but I'll work on it. :) Subject: kdenetwork/kopete/libkopete CVS commit by brunes: Fix regexp to handle any link type and not barf on @ symbols CCMAIL: 62690-done@bugs.kde.org M +2 -2 kopetemessage.cpp 1.130 --- kdenetwork/kopete/libkopete/kopetemessage.cpp #1.129:1.130 @@ -485,10 +485,10 @@ QString KopeteMessage::parseLinks( const //Replace http/https/ftp links - result.replace( QRegExp( QString::fromLatin1("(?:\\b| )((?:http(?:s?)://\\w|ftp://\\w)[-\\w\\._]+[\\+-\\w\\./#&;:=\\?~%_,]*)(?:\\b| )") ), QString::fromLatin1("<a href=\"\\1\" title=\"\\1\">\\1</a>" ) ); + result.replace( QRegExp( QString::fromLatin1("(?:\\b| )(\\w+://(\\w+\\@){0,1}[\\+-\\w\./#@&;:=\\?~%_,]*)(?:\\b| )") ), QString::fromLatin1("<a href=\"\\1\" title=\"\\1\">\\1</a>" ) ); result.replace( QRegExp( QString::fromLatin1("^(www\\.[-\\w\\._]+[\\+-\\w\\./#&;:=\\?~%_,]*)(?:\\b| )") ), QString::fromLatin1("<a href=\"http://\\1\" title=\"http://\\1\">\\1</a>" ) ); result.replace( QRegExp( QString::fromLatin1("([^/.;,?#=\\-%~])\\b(www\\.[\\+-\\w\\._]+[-\\w\\./#&;:=\\?~%_,]*)(?:\\b| )") ), QString::fromLatin1("\\1<a href=\"http://\\2\" title=\"http://\\2\">\\2</a>" ) ); //Replace Email Links - result.replace( QRegExp( QString::fromLatin1("(?:\\b| )([\\w\\-_\\.]+@(?:[\\+-_\\w\\.]+\\.\\w+)+)(?:\\b| )") ), QString::fromLatin1("<a href=\"mailto:\\1\" title=\"mailto:\\1\">\\1</a>") ); + result.replace( QRegExp( QString::fromLatin1("(?:\\b| )([\\w\\-_\\.]+@(?:[\\+-_\\w\\.]+\\.\\w+)+)(?:\\b| )(?!.*</a>)") ), QString::fromLatin1("<a href=\"mailto:\\1\" title=\"mailto:\\1\">\\1</a>") ); return result; |