Update skooma.js to handle numbers
This commit is contained in:
parent
5a1abac6e8
commit
a1677b151f
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
const parseAttribute = (attribute) => {
|
const parseAttribute = (attribute) => {
|
||||||
if (typeof(attribute) == "string")
|
if (typeof attribute == "string" || typeof attribute == "number")
|
||||||
return attribute
|
return attribute
|
||||||
else if ("join" in attribute)
|
else if ("join" in attribute)
|
||||||
return attribute.join(" ")
|
return attribute.join(" ")
|
||||||
|
@ -10,7 +10,7 @@ const parseAttribute = (attribute) => {
|
||||||
const parseArgs = (element, args) => {
|
const parseArgs = (element, args) => {
|
||||||
if (element.content) element = element.content
|
if (element.content) element = element.content
|
||||||
for (let arg of args)
|
for (let arg of args)
|
||||||
if (typeof(arg) == "string")
|
if (typeof arg == "string" || typeof arg == "number")
|
||||||
element.appendChild(document.createTextNode(arg))
|
element.appendChild(document.createTextNode(arg))
|
||||||
else if ("nodeName" in arg)
|
else if ("nodeName" in arg)
|
||||||
element.appendChild(arg)
|
element.appendChild(arg)
|
||||||
|
|
Loading…
Reference in a new issue