Commit bd7936bd authored by louiz’'s avatar louiz’

No more missing text when converting IRC colors to xhtml-im

fix #2496
parent 9683f0a0
......@@ -71,7 +71,7 @@ Xmpp::body irc_format_to_xhtmlim(const std::string& s)
const std::string txt = s.substr(pos_start, pos_end-pos_start);
cleaned += txt;
if (current_node->has_children())
......@@ -144,6 +144,10 @@ int main()
std::tie(cleaned_up, xhtml) = irc_format_to_xhtmlim(",");
assert(xhtml && !xhtml->has_children() && cleaned_up.empty());
std::tie(cleaned_up, xhtml) = irc_format_to_xhtmlim("[\x1D13dolphin-emu/dolphin\x1D] 03foo commented on #283 (Add support for the guide button to XInput): 02");
assert(xhtml->to_string() == "<body xmlns=''>[<span style='font-style:italic;'/><span style='font-style:italic;color:lightmagenta;'>dolphin-emu/dolphin</span><span style='color:lightmagenta;'>] </span><span style='color:green;'>foo</span> commented on #283 (Add support for the guide button to XInput): <span style='text-decoration:underline;'/><span style='text-decoration:underline;color:blue;'></span><span style='text-decoration:underline;'/></body>");
assert(cleaned_up == "[dolphin-emu/dolphin] foo commented on #283 (Add support for the guide button to XInput):");
* JID parsing
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment