fixed a hyperlink bug and a bug where > and < wouldn't display properly with rainbow text

This commit is contained in:
OmniTroid 2017-04-08 01:16:41 +02:00
parent f199006262
commit 122a461c42
2 changed files with 2 additions and 4 deletions

View File

@ -25,6 +25,7 @@ void AOTextArea::append_chatmessage(QString p_name, QString p_message)
{ {
if (i_word.startsWith("http")) if (i_word.startsWith("http"))
{ {
i_word.replace("\n", "").replace("\r", "");
this->insertHtml("<a href=\"" + i_word + "\">" + i_word + "</a> "); this->insertHtml("<a href=\"" + i_word + "\">" + i_word + "</a> ");
} }
else else

View File

@ -1192,13 +1192,10 @@ void Courtroom::chat_tick()
else else
{ {
QString f_character = f_message.at(tick_pos); QString f_character = f_message.at(tick_pos);
f_character = f_character.toHtmlEscaped();
if (f_character == " ") if (f_character == " ")
ui_vp_message->insertPlainText(" "); 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) else if (m_chatmessage[TEXT_COLOR].toInt() == RAINBOW)
{ {
QString html_color; QString html_color;