[Kde-pim] Another linklocator patch

Martin Koller kollix at aon.at
Sun Aug 23 21:56:44 BST 2009


Hi,

even after fixing a previous bug in the linklocator, we have another issue 
with it: https://bugs.kde.org/show_bug.cgi?id=202445

So I decided to modify the linklocator algorithm (after consulting RFC3986) to 
the following concept:

linklocator does not really parse an URL (and it never did), so it's not 
important if the URL in fact is really a completely valid url - this will be 
handled in the target application then.
What is important is that the URL is discovered, even if it is enclosed with 
some sort of brackets and even interrupted by line breaks or white space.
RFC3986 explains this in appendix C

So the modified code now handles these cases and it does not check for 
explicit allowed characters in all the different parts of a URL, which also 
has the advantage of fixing the mentioned bug. As said above: linklocator is 
not about checking the validity of the URL syntax.

Attached is the patch including a modified unit test.

P.S.:line breaks in URLs are still not working in kmail with this 
modification, because the LinkLocator::convertToHtml() has to be changed to 
not remove the line breaks before my new code gets a chance to use it.
I'll look into this in the next days, if time permits.

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linklocator.patch
Type: text/x-patch
Size: 7134 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090823/7890482b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090823/7890482b/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list