Add custom syntax for tagging spoilers
Currently the only two ways to spoiler text in your message is either: * Using the /spoiler command * Manually typing the data-mx-spoiler span HTML blocks Neither one is discoverable, or friendly to users really. Instead, we should extend our existing Markdown-based formatting syntax with one that can handle spoiler tags. I chose the || syntax to match Discord, since Element doesn't seem to adopt one. Unfortunately, CMark does not support custom extensions (see https://github.com/commonmark/cmark/pull/123) so we have to implement our own parsing function. New tests are also added for this too.
This commit is contained in:
@@ -140,6 +140,7 @@ private:
|
||||
QString escapeHtml(QString stringIn);
|
||||
QString unescapeHtml(QString stringIn);
|
||||
QString linkifyUrls(QString stringIn);
|
||||
QString customMarkdownToHtml(const QString &stringIn);
|
||||
|
||||
QString editString() const;
|
||||
QString emoteString(const NeoChatRoom *room = nullptr, const Quotient::RoomEvent *event = nullptr) const;
|
||||
|
||||
Reference in New Issue
Block a user