Update skooma.js to handle numbers

This commit is contained in:
Talia 2021-05-22 14:34:17 +02:00
parent 5a1abac6e8
commit a1677b151f
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -1,5 +1,5 @@
const parseAttribute = (attribute) => {
if (typeof(attribute) == "string")
if (typeof attribute == "string" || typeof attribute == "number")
return attribute
else if ("join" in attribute)
return attribute.join(" ")
@ -10,7 +10,7 @@ const parseAttribute = (attribute) => {
const parseArgs = (element, args) => {
if (element.content) element = element.content
for (let arg of args)
if (typeof(arg) == "string")
if (typeof arg == "string" || typeof arg == "number")
element.appendChild(document.createTextNode(arg))
else if ("nodeName" in arg)
element.appendChild(arg)