-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize outputs the doctype at the end / DOM Level2 Unavailable #29
Comments
Alright. I'll see what I can do. |
Ah, you're getting a DOM Level 1 from JSDOM -- Level 2 is required to get doctypes right, I think. |
I must admit that I struggled quite a bit to get html5 up and running - I've been doing browser-based JS for years, but am fairly new to node.js. It took me a while to figure out that I needed to set up a NODE_PATH environment variable to point to places where npm was installing things, otherwise html5 was just refusing to see jsdom at all. (Getting document.querySelector was important for me - I only managed to work that out by searching through jsdom's test code...) Chances are I've not got things set up quite "right", which probably explains why we're seeing differing results. For now I've worked around this problem by using a regex to move the doctype from the end of the outputted HTML to the beginning. I'll keep an eye out for updates - would be nice to remove my bodge. :-) |
Sweet. I'll keep working on the integration issues. It's mostly about getting jsdom's API to be more friendly to use via npm. I'll see about that! |
yeah, to be honest jsdom is pretty hosed on my local machine. I'll spend some time getting back to "a good place" this weekend |
Awesome! Poke me by twitter if you want help testing anything. |
If I try to serialize out a document, html5 is outputting the doctype at the end, rather than the beginning.
My simple-ish test-case code is:
What I see outputted to console is:
The text was updated successfully, but these errors were encountered: