Bug 291364 - Quotes are being added to links

Ahmed Ibrahim Khalil ahmedibrahimkhali at gmail.com
Mon Jun 17 22:52:02 UTC 2013


On Tue, Jun 18, 2013 at 12:12 AM, Martin Klapetek <martin.klapetek at gmail.com
> wrote:

> Hey,
>
> On Tue, Jun 18, 2013 at 12:00 AM, Ahmed Ibrahim Khalil <
> ahmedibrahimkhali at gmail.com> wrote:
>
>> Hi All,
>>
>> I've taken a look at that bug. And also had taken a look at the
>> mUrlRegExp inside the PostWidget.cpp file.
>>
>>
>> I am not good at RegExps so I thought to jump and ask the guys in
>> Freenode's #regexp about a good regular expression, that matches this case
>> and doesn't append the trailing character to the url.
>>
>
> If you're looking for a good RegExp to match urls, we have one in
> kde-telepathy, which is borrowed from Konversation, which apparently went
> through years of improvements etc. The best thing is that it's a QRegExp
> already. We've been using it for years and it works just fine. Feel free to
> borrow it from here:
>
>
> http://quickgit.kde.org/?p=ktp-common-internals.git&a=blob&h=46cf566bf3e5388bc12f84dd27c41863d025acaf&hb=347988c448dd503d7f1c813dd5b96ac293bcd20a&f=KTp%2Ftext-parser.cpp
>
>

Thanks alot Martin!
The QRegExp is working perfectly with trailing commas and quotes(that is
what I tried).

I just took the part that negates the trailing characters (the
[^\\s`!()\\[\\]{};:'\".,<>?%1%2%3%4%5%6] part)

And added it at the end to Choqok's QRegExp as I don't wont to modify it.
Maybe if Mehrdad said okay about replacing the current regexp with the one
in KDE-Telepathy.

I've added the patch as an attachment so that everyone could see the change
and if there is something wrong about it please inform me to correct it.

Thanks again Martin :)

Cheers
> --
> Martin Klapetek | KDE Developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/choqok-devel/attachments/20130618/13425f52/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trailingchars.patch
Type: application/octet-stream
Size: 1546 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/choqok-devel/attachments/20130618/13425f52/attachment.obj>


More information about the Choqok-devel mailing list