diff options
| author | OmniTroid <davidskoland@gmail.com> | 2017-04-08 01:16:41 +0200 |
|---|---|---|
| committer | OmniTroid <davidskoland@gmail.com> | 2017-04-08 01:16:41 +0200 |
| commit | 122a461c42a196bee20cd1f85fcad74e7ffff39c (patch) | |
| tree | dbf8b04736faa60e734c3ff76961774a3be31234 | |
| parent | f199006262f9f6e62df42ec8c15af345d89f9426 (diff) | |
fixed a hyperlink bug and a bug where > and < wouldn't display properly with rainbow text
| -rw-r--r-- | aotextarea.cpp | 1 | ||||
| -rw-r--r-- | courtroom.cpp | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/aotextarea.cpp b/aotextarea.cpp index a61a2486..06ae81e4 100644 --- a/aotextarea.cpp +++ b/aotextarea.cpp @@ -25,6 +25,7 @@ void AOTextArea::append_chatmessage(QString p_name, QString p_message) { if (i_word.startsWith("http")) { + i_word.replace("\n", "").replace("\r", ""); this->insertHtml("<a href=\"" + i_word + "\">" + i_word + "</a> "); } else diff --git a/courtroom.cpp b/courtroom.cpp index 2ac4f4f6..71972a92 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -1192,13 +1192,10 @@ void Courtroom::chat_tick() else { QString f_character = f_message.at(tick_pos); + f_character = f_character.toHtmlEscaped(); if (f_character == " ") ui_vp_message->insertPlainText(" "); - else if (f_character == "<") - ui_vp_message->insertHtml("<"); - else if (f_character == ">") - ui_vp_message->insertHtml(">"); else if (m_chatmessage[TEXT_COLOR].toInt() == RAINBOW) { QString html_color; |
