diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/util/html.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/util/html.js b/src/util/html.js index 8cb411b3..b4c29b88 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -155,13 +155,21 @@ export function blank() { } export function tag(tagName, ...args) { + const lastArg = args.at(-1); + + const lastArgIsAttributes = + typeof lastArg === 'object' && lastArg !== null && + !Array.isArray(lastArg) && + !(lastArg instanceof Tag) && + !(lastArg instanceof Template); + const content = - (isAttributes(args.at(-1)) + (lastArgIsAttributes ? null : args.at(-1)); const attributes = - (isAttributes(args.at(-1)) + (lastArgIsAttributes ? args : args.slice(0, -1)); |