Commit d375031f authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Albert Astals Cid
Browse files

Only turn http[s] links into clickable links

parent 3f865a87
......@@ -87,7 +87,7 @@ QString KNSResource::longDescription()
// Find anything that looks like a link (but which also is not some html
// tag value or another already) and make it a link
static const QRegularExpression urlRegExp(QStringLiteral("(^|\\s)([-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:;%_\\+.~#?&//=]*)?)"), QRegularExpression::CaseInsensitiveOption);
static const QRegularExpression urlRegExp(QStringLiteral("(^|\\s)(http[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:;%_\\+.~#?&//=]*)?)"), QRegularExpression::CaseInsensitiveOption);
ret.replace(urlRegExp, QStringLiteral("<a href=\"\\2\">\\2</a>"));
return ret;
Supports Markdown
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