From f6e71b233592270ad775dd21886ca70b9e02ac97 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 8 Jul 2019 16:55:56 +0200 Subject: [PATCH] turn flag into options object --- src/components/views/elements/MessageEditor.js | 2 +- src/editor/serialize.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/views/elements/MessageEditor.js b/src/components/views/elements/MessageEditor.js index 60e07bd951..cf306d80bb 100644 --- a/src/components/views/elements/MessageEditor.js +++ b/src/components/views/elements/MessageEditor.js @@ -90,7 +90,7 @@ function createEditContent(model, editedEvent) { body: `${plainPrefix} * ${body}`, }; - const formattedBody = htmlSerializeIfNeeded(model, /*forceHtml=*/ isReply); + const formattedBody = htmlSerializeIfNeeded(model, {forceHTML: isReply}); if (formattedBody) { newContent.format = "org.matrix.custom.html"; newContent.formatted_body = htmlPrefix + formattedBody; diff --git a/src/editor/serialize.js b/src/editor/serialize.js index 9790597b13..37565b64a0 100644 --- a/src/editor/serialize.js +++ b/src/editor/serialize.js @@ -33,10 +33,10 @@ export function mdSerialize(model) { }, ""); } -export function htmlSerializeIfNeeded(model, forceHtml = false) { +export function htmlSerializeIfNeeded(model, {forceHTML = false}) { const md = mdSerialize(model); const parser = new Markdown(md); - if (!parser.isPlainText() || forceHtml) { + if (!parser.isPlainText() || forceHTML) { return parser.toHTML(); } }