From 3b02766be98854c6c1b71211a6f1f0db47dc98cf Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 5 Mar 2018 07:33:18 +0000 Subject: [PATCH] isHtml makes no sense if there is no formatted_body this is a bug pre-replies but replies exacerbates it Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/HtmlUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 139c522932..026c6b1499 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -414,7 +414,7 @@ class TextHighlighter extends BaseHighlighter { * opts.stripReplyFallback: optional argument specifying the event is a reply and so fallback needs removing */ export function bodyToHtml(content, highlights, opts={}) { - const isHtml = (content.format === "org.matrix.custom.html"); + const isHtml = (content.format === "org.matrix.custom.html") && content.formatted_body; let body; if (isHtml) { body = content.formatted_body;