mediawiki-extensions-Visual.../modules/parser/html5/debug.js
Gabriel Wicke b750ce38b8 Add node.js-compatible HTML5 parser and hook it up to the PEG tokenizer.
Builds a DOM tree (jsdom) from the tokens and then serializes that using
document.innerHTML. This is all very experimental, so don't be surprised by
rough edges.
2011-11-18 13:57:07 +00:00

31 lines
548 B
JavaScript

var HTML5 = require('../html5');
var debugFlags = {any: true}
HTML5.debug = function() {
section = arguments[0];
if(debugFlags[section] || debugFlags[section.split('.')[0]]) {
var out = [];
for(var i in arguments) {
out.push(arguments[i])
}
console.dir(out)
}
}
HTML5.enableDebug = function(section) {
debugFlags[section] = true;
}
HTML5.disableDebug = function(section) {
debugFlags[section] = false;
}
HTML5.dumpTagStack = function(tags) {
var r = [];
for(i in tags) {
r.push(tags[i].tagName);
}
return r.join(', ');
}