User:Proteins/unindent.js: Difference between revisions

Content deleted Content added
Proteins (talk | contribs)
navigate up tree to determine indent level
Proteins (talk | contribs)
m need iterator
Line 43:
 
while ((parent_node) && (parent_node != top_node)) {
if (parent_node.nodeType != 1) {
parent_node = parent_node.parentNode;
continue;
} // examine only Element nodes
 
if (parent_node.nodeName == "DL") {
Line 54 ⟶ 57:
top_DL_node = parent_node;
} // closes check for a parental DL element
 
parent_node = parent_node.parentNode;
} // closes loop climbing up the document tree