Version: (using KDE KDE 3.2.2) Installed from: Compiled From Sources In web fora or e-mails of certain MUAs, long urls are often broken across multiple lines. When mmb-pasting, these URLs contain %0As. Those are removed iff no space follows the linebreak. However, a khtml selected url will almost always contain linebreaks which have a following space. F. i.: http://.../very/lo ng/url selected from KHTML will be pasted as http://.../very/lo%0A ng/url on mmb. Note the space that is following the line break. I propose that any space following a linebreak is removed.
This isn't a wishlist item. The original feature (remove linefeeds from pasted urls) already works. This report is about a special circumstance in which linefeed removal fails. Maybe the wording in the summary is misleading. I'll change it to reflect the bug-like nature of this report.
CVS commit by waba: Remove linefeeds and any whitespace surrounding it from pasted URLs (BR82325) CCMAIL: 82325-done@bugs.kde.org M +3 -0 browserextension.cpp 1.63 --- kdelibs/kparts/browserextension.cpp #1.62:1.63 @@ -25,4 +25,5 @@ #include <qobjectlist.h> #include <qmetaobject.h> +#include <qregexp.h> #include <qstrlist.h> #include <qstylesheet.h> @@ -430,4 +431,6 @@ void BrowserExtension::pasteRequest() QCString plain("plain"); QString url = QApplication::clipboard()->text(plain, QClipboard::Selection).stripWhiteSpace(); + // Remove linefeeds and any whitespace surrounding it. + url.replace(QRegExp("[\\ ]*\\n+[\\ ]*"),""); // Check if it's a URL