We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a7b6b9 commit 6b9c70bCopy full SHA for 6b9c70b
README.md
@@ -83,13 +83,13 @@ One task `undom` doesn't handle for you by default is HTML serialization. A pro
83
Element.prototype.toString = function() { return serialize(this); };
84
85
function serialize(el) {
86
- return el.nodeType==3 ? enc(el.data) : (
+ return el.nodeType==3 ? enc(el.nodeValue) : (
87
'<'+this.nodeName.toLowerCase() + this.attributes.map(attr).join('') + '>' +
88
this.childNodes.map(serialize).join('') + '</'+this.nodeName.toLowerCase()+'>'
89
);
90
}
91
let attr = a => ` ${a.name}="${enc(a.value)}"`;
92
-let enc = s => s.replace(/[&'"<>]/g, a => `&#${a};`);
+let enc = s => s.replace(/[&'"<>]/g, a => `&#${a.codePointAt(0)};`);
93
```
94
95
0 commit comments