From 8f44cc21db4398af26ff93521a0be44d6bd213df Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 2 Jul 2021 00:41:17 -0700 Subject: [PATCH] Correct two uses of `==`. --- src/platform/web/dom/deserialize.js | 4 ++-- src/platform/web/ui/session/room/timeline/TextMessageView.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/web/dom/deserialize.js b/src/platform/web/dom/deserialize.js index 41acf792..9cb0834e 100644 --- a/src/platform/web/dom/deserialize.js +++ b/src/platform/web/dom/deserialize.js @@ -47,7 +47,7 @@ function parseList(node) { function parseCodeBlock(node) { let codeNode; - if (!((codeNode = node.firstChild) && codeNode.nodeName == "CODE")) { + if (!((codeNode = node.firstChild) && codeNode.nodeName === "CODE")) { return null; } let language = ""; @@ -101,7 +101,7 @@ const nodes = buildNodeMap(); function parseNode(node) { if (node.nodeType === Node.TEXT_NODE) { return new TextPart(node.nodeValue); - } else if (node.nodeType == Node.ELEMENT_NODE) { + } else if (node.nodeType === Node.ELEMENT_NODE) { const f = nodes[node.nodeName]; if (!f) { return null; diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js index 9c9277fb..5809cca9 100644 --- a/src/platform/web/ui/session/room/timeline/TextMessageView.js +++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js @@ -38,7 +38,7 @@ export class TextMessageView extends BaseMessageView { const formatFunction = { header: headerBlock => tag["h" + Math.min(6,headerBlock.level)]({}, renderParts(headerBlock.inlines)), codeblock: codeBlock => tag.pre({}, tag.code({}, text(codeBlock.text))), - emph: emphPart => tag.em({}, renderPart(emphPart.inlines)), + emph: emphPart => tag.em({}, renderParts(emphPart.inlines)), code: codePart => tag.code({}, text(codePart.text)), text: textPart => text(textPart.text), link: linkPart => tag.a({ href: linkPart.url, target: "_blank", rel: "noopener" }, renderParts(linkPart.inlines)),