refactor(plugins): stackoverflow rewrite to jsx

This commit is contained in:
Artemy
2024-05-13 18:42:12 +03:00
parent c2e6475624
commit 78e45f3c80
3 changed files with 50 additions and 14 deletions

View File

@ -23,7 +23,10 @@ export function createElement(
else return `${key}=${value}`;
})
.join(' ');
return `<${name} ${propsstr}>${content.join('')}</${name}>`;
return content.length === 0
? `<${name} ${propsstr}/>`
: `<${name} ${propsstr}>${content.join('')}</${name}>`;
} else if (typeof name === 'function') {
return name(props, ...content);
} else {