Commit 3df67f69 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 313719 - A URL followed by a ) is parsed incorrectly in message viewer

now we can set correct url when we finish url by ). or other special exclude characters

FIXED-IN: 4.10.1
BUG: 313719
parent b0cdec92
......@@ -156,13 +156,17 @@ QString LinkLocator::getUrl()
// a dot to finish the sentence. That would lead the parser to include the dot in the url,
// even though that is not wanted. So work around that here.
// Most real-life URLs hopefully don't end with dots or commas.
QList<QChar> wordBoundaries;
wordBoundaries << '.' << ',' << ':' << '!' << '?' << ')';
if ( url.length() > 1 ) {
QList<QChar> wordBoundaries;
wordBoundaries << '.' << ',' << ':' << '!' << '?' << ')';
if ( wordBoundaries.contains( url.at( url.length() - 1 ) ) ) {
url.chop( 1 );
--mPos;
}
do {
if ( wordBoundaries.contains( url.at( url.length() - 1 ) ) ) {
url.chop( 1 );
--mPos;
} else {
break;
}
} while( url.length() > 1 );
}
return url;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment