turn flag into options object
This commit is contained in:
parent
e601037cd2
commit
f6e71b2335
2 changed files with 3 additions and 3 deletions
|
@ -90,7 +90,7 @@ function createEditContent(model, editedEvent) {
|
||||||
body: `${plainPrefix} * ${body}`,
|
body: `${plainPrefix} * ${body}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const formattedBody = htmlSerializeIfNeeded(model, /*forceHtml=*/ isReply);
|
const formattedBody = htmlSerializeIfNeeded(model, {forceHTML: isReply});
|
||||||
if (formattedBody) {
|
if (formattedBody) {
|
||||||
newContent.format = "org.matrix.custom.html";
|
newContent.format = "org.matrix.custom.html";
|
||||||
newContent.formatted_body = htmlPrefix + formattedBody;
|
newContent.formatted_body = htmlPrefix + formattedBody;
|
||||||
|
|
|
@ -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 md = mdSerialize(model);
|
||||||
const parser = new Markdown(md);
|
const parser = new Markdown(md);
|
||||||
if (!parser.isPlainText() || forceHtml) {
|
if (!parser.isPlainText() || forceHTML) {
|
||||||
return parser.toHTML();
|
return parser.toHTML();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue