mirror of
https://github.com/MercuryWorkshop/dreamlandjs.git
synced 2025-05-16 23:50:00 -04:00
svg fix
This commit is contained in:
parent
2dcae6ad11
commit
696a60ee1e
1 changed files with 6 additions and 1 deletions
7
js.js
7
js.js
|
@ -200,7 +200,8 @@ export function h(type, props, ...children) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const elm = document.createElement(type);
|
let xmlns = props?.xmlns;
|
||||||
|
const elm = xmlns ? document.createElementNS(xmlns, type) : document.createElement(type);
|
||||||
|
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
JSXAddChild(child, elm.appendChild.bind(elm));
|
JSXAddChild(child, elm.appendChild.bind(elm));
|
||||||
|
@ -389,6 +390,10 @@ export function h(type, props, ...children) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hack to fix svgs
|
||||||
|
if (xmlns)
|
||||||
|
elm.innerHTML = elm.innerHTML
|
||||||
|
|
||||||
return elm;
|
return elm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue