Don't render custom emojis in code blocks

BUG: 458993
This commit is contained in:
Tobias Fella
2022-11-17 21:38:49 +01:00
parent debf2e41d6
commit 2920247ab4
2 changed files with 15 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ using namespace Quotient;
QString markdownToHTML(const QString &markdown)
{
const auto str = markdown.toUtf8();
char *tmp_buf = cmark_markdown_to_html(str.constData(), str.size(), CMARK_OPT_HARDBREAKS);
char *tmp_buf = cmark_markdown_to_html(str.constData(), str.size(), CMARK_OPT_HARDBREAKS | CMARK_OPT_UNSAFE);
const std::string html(tmp_buf);
@@ -137,8 +137,8 @@ void ActionsHandler::handleMessage()
}
}
handledText = markdownToHTML(handledText);
handledText = CustomEmojiModel::instance().preprocessText(handledText);
handledText = markdownToHTML(handledText);
if (handledText.length() == 0) {
return;