mirror of https://notabug.org/acetone/ircabot.git
whitespace in links end fix(2)
parent
84b9e48f7d
commit
d9d1c5ba74
|
@ -85,7 +85,9 @@ std::pair<QString, QString> HttpServer::splitUserNameAndMessage(const QString &r
|
|||
text = text.toHtmlEscaped();
|
||||
|
||||
// http links
|
||||
bool linksFound {false};
|
||||
while (QRegularExpression("(^|\\s)http.?://").match(text).hasMatch()) {
|
||||
if (not linksFound) linksFound = true;
|
||||
int pos = text.indexOf(QRegularExpression("(^|\\s)http.?://"));
|
||||
if (pos == -1) {
|
||||
consoleLog("Bug! HttpServer.cpp while (QRegularExpression(\"(^|\\s)http.?://\").match(text).hasMatch())");
|
||||
|
@ -102,7 +104,7 @@ std::pair<QString, QString> HttpServer::splitUserNameAndMessage(const QString &r
|
|||
}
|
||||
text.replace(rawLink, convertToClickableLink(rawLink));
|
||||
}
|
||||
text.replace(" </a>", "</a>"); // delete whitespace in links end
|
||||
if (linksFound) text.replace(" </a>", "</a>"); // delete whitespace in links end
|
||||
|
||||
// long lines
|
||||
int space = 0;
|
||||
|
|
Loading…
Reference in New Issue