Add rendering for horizontal rules

This commit is contained in:
Danila Fedorin 2021-08-06 15:50:03 -07:00
parent e68df1b324
commit f239199b1b
3 changed files with 3 additions and 2 deletions

View file

@ -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"]
};

View file

@ -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()