mirror of https://notabug.org/acetone/ircabot.git
fix for long lines
parent
a78db0a110
commit
51541270f5
|
@ -249,6 +249,7 @@ body {
|
||||||
|
|
||||||
.main_payload__chat_mail {
|
.main_payload__chat_mail {
|
||||||
flex: 89%;
|
flex: 89%;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main_payload__error {
|
.main_payload__error {
|
||||||
|
|
|
@ -612,7 +612,19 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
|
|
||||||
QString text {buffer};
|
QString text {buffer};
|
||||||
text.remove(QRegularExpression("^\\[.*\\]\\s"));
|
text.remove(QRegularExpression("^\\[.*\\]\\s"));
|
||||||
text.replace(' ', " "); // for long spaces (code examples, etc)
|
if (text.size() < 30) {
|
||||||
|
text.replace(' ', " "); // for long spaces (code examples, etc)
|
||||||
|
} else {
|
||||||
|
while (QRegularExpression("[^\\s]{50,10000}.*").match(text).hasMatch()) {
|
||||||
|
int pos = text.indexOf(QRegularExpression("[^\\s]{50,10000}.*"));
|
||||||
|
if (pos == -1) {
|
||||||
|
consoleLog("Bug! HttpServer.cpp while (QRegularExpression(\"[^\\s]{50,10000}.*\").match(text).hasMatch())");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
text.insert(pos+25, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (text.isEmpty()) continue;
|
if (text.isEmpty()) continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue