mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
util.inspect to dump tokens
It gets a better output over JSON.stringify since inspect nicely indent the object/array dump. Makes it easier to read for humans.
This commit is contained in:
parent
dbe4890ed6
commit
350d1e8978
|
@ -18,6 +18,7 @@ var fs = require('fs'),
|
|||
path = require('path'),
|
||||
jsDiff = require('diff'),
|
||||
colors = require('colors'),
|
||||
util = require( 'util' ),
|
||||
HTML5 = require('html5').HTML5;
|
||||
|
||||
// Name of file used to cache the parser tests cases
|
||||
|
@ -386,7 +387,9 @@ function processTest(item) {
|
|||
});
|
||||
//var res = es.HtmlSerializer.stringify(tokens,environment);
|
||||
//console.log(JSON.stringify(tokens));
|
||||
|
||||
//Slightly better token output debugging:
|
||||
//console.log( util.inspect( tokens, false, null ).yellow);
|
||||
|
||||
// Build a DOM tree from tokens using the HTML tree
|
||||
// builder/parser.
|
||||
processTokens(tokens, tokenizer);
|
||||
|
|
Loading…
Reference in a new issue