summaryrefslogtreecommitdiff
path: root/src/bridge/colors.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-06-08 05:35:36 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-06-08 05:35:36 +0200
commit3d9183557f3ad9b599c812c03a445453e7d4f703 (patch)
treeb084919560ecae720ceb43efc0c3dcf2e1434b7e /src/bridge/colors.cpp
parent2d5e2fdcf69416bd93982e1432b4d2b744da203e (diff)
downloadbiboumi-3d9183557f3ad9b599c812c03a445453e7d4f703.tar.gz
biboumi-3d9183557f3ad9b599c812c03a445453e7d4f703.tar.bz2
biboumi-3d9183557f3ad9b599c812c03a445453e7d4f703.tar.xz
biboumi-3d9183557f3ad9b599c812c03a445453e7d4f703.zip
Convert \n to <br/> in xhtml body
fix #2539
Diffstat (limited to 'src/bridge/colors.cpp')
-rw-r--r--src/bridge/colors.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bridge/colors.cpp b/src/bridge/colors.cpp
index 6f6d7a9..3aed07c 100644
--- a/src/bridge/colors.cpp
+++ b/src/bridge/colors.cpp
@@ -77,6 +77,13 @@ Xmpp::body irc_format_to_xhtmlim(const std::string& s)
if (s[pos_end] == IRC_FORMAT_BOLD_CHAR)
styles.strong = !styles.strong;
+ else if (s[pos_end] == IRC_FORMAT_NEWLINE_CHAR)
+ {
+ XmlNode* br_node = new XmlNode("br");
+ br_node->close();
+ current_node->add_child(br_node);
+ cleaned += '\n';
+ }
else if (s[pos_end] == IRC_FORMAT_UNDERLINE_CHAR)
styles.underline = !styles.underline;
else if (s[pos_end] == IRC_FORMAT_ITALIC_CHAR)