Summary: | [patch] Trim whitespace/linebreaks in wrapped (long) URLs when using context menu "Open ..."-action | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Daniel Hahler <kde-bugzilla> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | finex |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
testcase
patch to fix patch |
Description
Daniel Hahler
2005-09-24 00:51:36 UTC
This is with Kubuntu's KDE 3.5beta 1. Confirmed on r620k. Patch and testcase to be attached. Created attachment 19151 [details]
testcase
Created attachment 19152 [details]
patch to fix
Patch to be applied in kdelibs/khtml
There are more testcases in Bug 134190 (dupe). It would be great, if the patch would get tested against those testcases as well and then committed for 3.5.7! I would recommend + url.replace(QRegExp("[\\s]*\\n+[\\s]*"),""); instead of + url.replace(QRegExp("[\\ ]*\\n+[\\ ]*"),""); notice that the space is replaced by a s. (\s represents whitespace of all types in regular expressions). Otherwise I'm not sure why you need the backslashes in the square-bracketed expressions. Also please try to follow the style of the rest of the code. The url=m_part->... line should have spaces around the equal sign for instance. Other than that I think it's fine. It should be applied even on Konqueror 4. SVN commit 826895 by dfaure: Fix handling of selected text in context menu actions: * "search in <search provider>" should ignore leading/trailing whitespace, as well as the special char * "open <url>" (when the selected text looks like a URL) should also ignore linefeeds, i.e. treat the selection as a single line. BUG: 113177 M +36 -21 khtml_ext.cpp M +3 -1 khtml_ext.h M +15 -4 khtml_part.cpp M +12 -3 khtml_part.h WebSVN link: http://websvn.kde.org/?view=rev&revision=826895 Created attachment 27615 [details]
patch
A very useful future is to offer "Open url" even for selected text starting with "www.". Patch attached .
|