diff --git a/html/style.css b/html/style.css
index d4e7c50..1df2c2d 100644
--- a/html/style.css
+++ b/html/style.css
@@ -249,6 +249,7 @@ body {
.main_payload__chat_mail {
flex: 89%;
+ word-wrap: break-word;
}
.main_payload__error {
diff --git a/httpserver.cpp b/httpserver.cpp
index 065d021..59e3592 100644
--- a/httpserver.cpp
+++ b/httpserver.cpp
@@ -612,7 +612,19 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
QString text {buffer};
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;