summary refs log tree commit diff
path: root/src/timeline/TimelineView.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-09-07 20:05:30 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-09-07 20:05:30 +0300
commit9e8f0b7409ff34b1235908b4c9d619b2a43d7a11 (patch)
tree558863c4a701f159492b0ce700db3b29c8969e1c /src/timeline/TimelineView.cpp
parentFix double href links on username pills (diff)
downloadnheko-9e8f0b7409ff34b1235908b4c9d619b2a43d7a11.tar.xz
Initial support for sending markdown formatted messages
fixes #283
Diffstat (limited to 'src/timeline/TimelineView.cpp')
-rw-r--r--src/timeline/TimelineView.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/timeline/TimelineView.cpp b/src/timeline/TimelineView.cpp

index bf828a8e..d09f5d5f 100644 --- a/src/timeline/TimelineView.cpp +++ b/src/timeline/TimelineView.cpp
@@ -1233,8 +1233,12 @@ template<> mtx::events::msg::Emote toRoomMessage<mtx::events::msg::Emote>(const PendingMessage &m) { + auto html = utils::markdownToHtml(m.body); + mtx::events::msg::Emote emote; - emote.body = m.body.toStdString(); + emote.body = utils::stripHtml(html); + emote.formatted_body = html; + return emote; } @@ -1254,8 +1258,15 @@ template<> mtx::events::msg::Text toRoomMessage<mtx::events::msg::Text>(const PendingMessage &m) { + auto html = utils::markdownToHtml(m.body); + mtx::events::msg::Text text; - text.body = m.body.toStdString(); + text.body = utils::stripHtml(html); + text.formatted_body = html; + + std::cout << "body: " << text.body << std::endl; + std::cout << "formatted_body: " << text.formatted_body << std::endl; + return text; }