fix: support number elements in jsx templates

This commit is contained in:
M. George Hansen 2020-06-02 15:38:39 -07:00
parent 5dfd2fd053
commit 1372ce16cb
Signed by: mgeorgehansen
SSH key fingerprint: SHA256:JlIGiQLPyQ2RHTH3a2oVlb20Xkh9Glr8DUF4YTXHJxM
3 changed files with 16 additions and 1 deletions

View file

@ -22,6 +22,9 @@ const renderElement = (elem: Element): string => {
if (elem == null || typeof elem === "boolean") {
return "";
}
if (typeof elem === "number") {
return elem.toString();
}
if (typeof elem === "string") {
return escapeHtml(elem);
}