From f239199b1bf8cfcdbfb6f8a30c3d8a20a8e4434c Mon Sep 17 00:00:00 2001
From: Danila Fedorin <danila.fedorin@gmail.com>
Date: Fri, 6 Aug 2021 15:50:03 -0700
Subject: [PATCH] Add rendering for horizontal rules

---
 src/domain/session/room/timeline/MessageBody.js              | 2 +-
 src/platform/web/ui/general/html.js                          | 2 +-
 src/platform/web/ui/session/room/timeline/TextMessageView.js | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/domain/session/room/timeline/MessageBody.js b/src/domain/session/room/timeline/MessageBody.js
index b3cf532e..a8bf2497 100644
--- a/src/domain/session/room/timeline/MessageBody.js
+++ b/src/domain/session/room/timeline/MessageBody.js
@@ -74,7 +74,7 @@ export class TableBlock {
 }
 
 export class RulePart {
-    get type( ) { return "rule"; }
+    get type() { return "rule"; }
 }
 
 export class NewLinePart {
diff --git a/src/platform/web/ui/general/html.js b/src/platform/web/ui/general/html.js
index 4be81e3b..f12ad306 100644
--- a/src/platform/web/ui/general/html.js
+++ b/src/platform/web/ui/general/html.js
@@ -94,7 +94,7 @@ export const TAG_NAMES = {
     [HTML_NS]: [
         "br", "a", "ol", "ul", "li", "div", "h1", "h2", "h3", "h4", "h5", "h6",
         "p", "strong", "em", "span", "img", "section", "main", "article", "aside", "del", "blockquote",
-        "table", "thead", "tbody", "tr", "th", "td",
+        "table", "thead", "tbody", "tr", "th", "td", "hr",
         "pre", "code", "button", "time", "input", "textarea", "label", "form", "progress", "output", "video"],
     [SVG_NS]: ["svg", "circle"]
 };
diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js
index 5a1ac374..0a0a75cf 100644
--- a/src/platform/web/ui/session/room/timeline/TextMessageView.js
+++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js
@@ -97,6 +97,7 @@ const formatFunction = {
     link: linkPart => tag.a({href: linkPart.url, className: "link", target: "_blank", rel: "noopener" }, renderParts(linkPart.inlines)),
     pill: renderPill,
     format: formatPart => tag[formatPart.format](renderParts(formatPart.children)),
+    rule: rulePart => tag.hr(),
     list: renderList,
     image: renderImage,
     newline: () => tag.br()