You can clone with
HTTPS or Subversion.
I'm having issues iterating over the list of attributes on an element. Here's sample code:
domino = require('domino');
window = domino.createWindow("<h1 lang='en'>Hello</h1>");
h1 = window.document.body.firstChild;
// Outputs 1
// Returns undefined, expected an object
@cscott Understood, and I was already using that workaround, filed just in case. How are you able to get around this for childNodes and other collections?
That said, it seems like it might be possible to re-engineer the representation of attributes such that Element.attributes is the One True Place to find attribute information, rewriting all the other ways to access attributes to use it. This would be a pretty invasive change, though, and if users tried to mutate the attributes array directly (in theory it is read-only, but in practice it would have to be writable) then Bad Things would happen.
Understood. Thanks for the explanation.
I'm leaving this bug open to remind me to add a note to the documentation explaining that array accesses on Element.attributes are not supported (use .item() instead).
Describe issues with Element.attributes. (closes gh #27)