fixed ANOTHER bug with hyperlinks zzzzz 2.4.1

This commit is contained in:
OmniTroid 2017-05-24 16:06:49 +02:00
parent 819034e5ad
commit 1f0560d63f
2 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,7 @@ RC_ICONS = logo.ico
TARGET = Attorney_Online_remake
TEMPLATE = app
VERSION = 2.4.0.0
VERSION = 2.4.1.0
SOURCES += main.cpp\
lobby.cpp \

View File

@ -22,6 +22,8 @@ void AOTextArea::append_chatmessage(QString p_name, QString p_message)
QRegExp regExp("((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[\\-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9\\.\\-]+|(?:www\\.|[\\-;:&=\\+\\$,\\w]+@)[A-Za-z0-9\\.\\-]+)((?:\\/[\\+~%\\/\\.\\w\\-]*)?\\??(?:[\\-\\+=&;%@\\.\\w]*)#?(?:[\\.\\!\\/\\\\\\w]*))?)");
//cheap workarounds ahoy
p_message += " ";
QString result = p_message.toHtmlEscaped().replace("\n", "<br>").replace(regExp, "<a href='\\1'>\\1</a>" );
this->insertHtml(result);