1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-25 22:14:32 +00:00

Preserve plain text formatting

This commit is contained in:
Chocobo1 2015-06-24 18:49:31 +08:00
parent b318f54fdf
commit 9d5cfbcda9

View File

@ -467,6 +467,8 @@ QString Utils::Misc::parseHtmlLinks(const QString &raw_text)
static QRegExp reNoScheme("<a\\s+href=\"(?!http(s?))([a-zA-Z0-9\\?%=&/_\\.-:#]+)\\s*\">"); static QRegExp reNoScheme("<a\\s+href=\"(?!http(s?))([a-zA-Z0-9\\?%=&/_\\.-:#]+)\\s*\">");
result.replace(reNoScheme, "<a href=\"http://\\1\">"); result.replace(reNoScheme, "<a href=\"http://\\1\">");
// to preserve plain text formatting
result = "<p style=\"white-space: pre-wrap;\">" + result + "</p>";
return result; return result;
} }