Created
July 16, 2010 21:14
-
-
Save hober/478925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Using aredridel/html5 and tmpvar/jsdom */ | |
var sys = require('sys'); | |
var HTML5 = require('html5'); | |
var p = new HTML5.Parser("<p>hello, world"); | |
p.parse(); | |
var doc = p.document; | |
var head = doc.getElementsByTagName('head').item(0); | |
var metaCharset = doc.createElement('meta'); | |
head.appendChild(metaCharset); | |
metaCharset.setAttribute('charset', 'utf-8'); | |
sys.puts(HTML5.serialize(doc)); |
metaCharset._attributes.length
is 0
, which leads me to believe the problem is in jsdom.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is what gets printed when I run the above:
Notice the incorrect
meta
element.