summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/InputBar.cpp10
-rw-r--r--src/timeline/InputBar.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index b6355418..94944337 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -465,6 +465,14 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow text.formatted_body = ""; else text.format = "org.matrix.custom.html"; + } else if (useMarkdown == MarkdownOverride::CMARK) { + // disable all markdown extensions + text.formatted_body = utils::markdownToHtml(msg, rainbowify, true).toStdString(); + // keep everything as it was + text.body = msg.trimmed().toStdString(); + + // always send formatted + text.format = "org.matrix.custom.html"; } text.relations = generateRelations(); @@ -802,6 +810,8 @@ InputBar::command(const QString &command, QString args) cache::dropOutboundMegolmSession(room->roomId().toStdString()); } else if (command == QLatin1String("md")) { message(args, MarkdownOverride::ON); + } else if (command == QLatin1String("cmark")) { + message(args, MarkdownOverride::CMARK); } else if (command == QLatin1String("plain")) { message(args, MarkdownOverride::OFF); } else if (command == QLatin1String("rainbow")) { diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index eb261b02..32e3deee 100644 --- a/src/timeline/InputBar.h +++ b/src/timeline/InputBar.h
@@ -40,6 +40,7 @@ enum class MarkdownOverride NOT_SPECIFIED, // no override set ON, OFF, + CMARK, }; class InputVideoSurface final : public QAbstractVideoSurface