forked from mystiq/hydrogen-web
Merge pull request #450 from vector-im/hr-fix
Add rendering for horizontal rules
This commit is contained in:
commit
d9d76839c5
3 changed files with 3 additions and 2 deletions
|
@ -74,7 +74,7 @@ export class TableBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RulePart {
|
export class RulePart {
|
||||||
get type( ) { return "rule"; }
|
get type() { return "rule"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NewLinePart {
|
export class NewLinePart {
|
||||||
|
|
|
@ -94,7 +94,7 @@ export const TAG_NAMES = {
|
||||||
[HTML_NS]: [
|
[HTML_NS]: [
|
||||||
"br", "a", "ol", "ul", "li", "div", "h1", "h2", "h3", "h4", "h5", "h6",
|
"br", "a", "ol", "ul", "li", "div", "h1", "h2", "h3", "h4", "h5", "h6",
|
||||||
"p", "strong", "em", "span", "img", "section", "main", "article", "aside", "del", "blockquote",
|
"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"],
|
"pre", "code", "button", "time", "input", "textarea", "label", "form", "progress", "output", "video"],
|
||||||
[SVG_NS]: ["svg", "circle"]
|
[SVG_NS]: ["svg", "circle"]
|
||||||
};
|
};
|
||||||
|
|
|
@ -97,6 +97,7 @@ const formatFunction = {
|
||||||
link: linkPart => tag.a({href: linkPart.url, className: "link", target: "_blank", rel: "noopener" }, renderParts(linkPart.inlines)),
|
link: linkPart => tag.a({href: linkPart.url, className: "link", target: "_blank", rel: "noopener" }, renderParts(linkPart.inlines)),
|
||||||
pill: renderPill,
|
pill: renderPill,
|
||||||
format: formatPart => tag[formatPart.format](renderParts(formatPart.children)),
|
format: formatPart => tag[formatPart.format](renderParts(formatPart.children)),
|
||||||
|
rule: rulePart => tag.hr(),
|
||||||
list: renderList,
|
list: renderList,
|
||||||
image: renderImage,
|
image: renderImage,
|
||||||
newline: () => tag.br()
|
newline: () => tag.br()
|
||||||
|
|
Loading…
Reference in a new issue