feat: support rendering array elements

This commit is contained in:
M. George Hansen 2020-06-02 16:39:44 -07:00
parent 75ed8c6537
commit ed547cc851
Signed by: mgeorgehansen
SSH key fingerprint: SHA256:JlIGiQLPyQ2RHTH3a2oVlb20Xkh9Glr8DUF4YTXHJxM
4 changed files with 35 additions and 14 deletions

View file

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