feat: support rendering array elements
This commit is contained in:
parent
75ed8c6537
commit
ed547cc851
4 changed files with 35 additions and 14 deletions
|
|
@ -28,6 +28,9 @@ const renderElement = (elem: Element): string => {
|
|||
if (typeof elem === "string") {
|
||||
return escapeHtml(elem);
|
||||
}
|
||||
if (Array.isArray(elem)) {
|
||||
return elem.map((e) => renderElement(e)).join("");
|
||||
}
|
||||
|
||||
let output = "";
|
||||
output += startTag(elem);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue