aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmniTroid <davidskoland@gmail.com>2017-04-08 01:16:41 +0200
committerOmniTroid <davidskoland@gmail.com>2017-04-08 01:16:41 +0200
commit122a461c42a196bee20cd1f85fcad74e7ffff39c (patch)
treedbf8b04736faa60e734c3ff76961774a3be31234
parentf199006262f9f6e62df42ec8c15af345d89f9426 (diff)
fixed a hyperlink bug and a bug where > and < wouldn't display properly with rainbow text
-rw-r--r--aotextarea.cpp1
-rw-r--r--courtroom.cpp5
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("&lt;");
- else if (f_character == ">")
- ui_vp_message->insertHtml("&gt;");
else if (m_chatmessage[TEXT_COLOR].toInt() == RAINBOW)
{
QString html_color;