mediawiki-extensions-Visual.../modules/parser/html5/debug.js
Gabriel Wicke 59fc634cce Update patched html5 library to version 0.3.8
Change-Id: I321d9a58ea1af33842a606fc8706938093a8330f
2012-06-06 10:17:03 +02:00

32 lines
608 B
JavaScript

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