jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
819 stars 265 forks source link

fixed replaceChild bug #229

Open Gcaufy opened 6 years ago

Gcaufy commented 6 years ago
// node: <div><slot /></div>
// newChild: Hello World
// oldChild: <slot />

node.replaceChild(newChild, oldChild);

// Expect: <div>Hello World</div>
// Actually: Hello World

But if I added a space befor <slot />, I get the correct result.

// node: <div> <slot /></div>
// newChild: Hello World
// oldChild: <slot />

node.replaceChild(newChild, oldChild);

// Expect: <div> Hello World</div>
// Actually: <div> Hello World</div>