Permalink
Browse files

snippets to reproduce library bugs

  • Loading branch information...
1 parent ef17eba commit 76ce9d348df4f6192e250292798554679bf8929e @arrix arrix committed Nov 30, 2010
View
@@ -0,0 +1,38 @@
+var request = require('request');
+var jsdom = require('jsdom');
+
+var url = 'http://www.w3.org/TR/css3-2d-transforms/';
+request({uri:url}, function (error, response, body) {
+ var html = body;
+ var doc = jsdom.jsdom(html, null, {url: url});
+ console.log(doc.head+''); //[ HEAD ]
+ console.log(doc.body === null); //true
+ console.log(doc.head.childNodes[9].tagName); //BODY
+});
+
+var doc = jsdom.jsdom(html, null, {url: ''});
+
+
+var HTML5 = require('html5');
+var fs = require('fs');
+var content = fs.readFileSync('test/css.html', 'utf-8');
+var html = content;
+var jsdom = require('jsdom');
+var browser = jsdom.browserAugmentation(jsdom.defaultLevel);
+
+var doc = new browser.HTMLDocument();
+var parser = new HTML5.Parser({document: doc});
+parser.parse(html);
+
+var doc2 = jsdom.jsdom(html, null, {parser: HTML5});
+
+
+
+
+var htmlparser = require("htmlparser");
+var handler = new htmlparser.DefaultHandler(function (error, dom) {
+
+});
+var parser = new htmlparser.Parser(handler);
+parser.parseComplete(html);
+sys.puts(sys.inspect(handler.dom, false, null));
File renamed without changes.
View
@@ -9,19 +9,21 @@ function cleanFile(path, url, cb) {
var content = fs.readFileSync(path, 'utf-8');
readability.parse(content, url, cb);
}
-
-// cleanFile(__dirname + '/pages/Proyectos_de_creaci_n_de_empresas___til_para_el_emprendedor__Ofertas____.html', '', function(info) {
-// //console.log(info.content);
-// });
-//
-// return;
+if (1) {
+ cleanFile(__dirname + '/weird-pages/w3c-css-no-closing-head.html', '', function(info) {
+ //console.log(info.content);
+ });
+
+ return;
+}
function batch_run() {
var dir = __dirname + '/pages/';
var files = fs.readdirSync(dir);
var results = [];
//files.length = 10;
files.forEach(function(f) {
+ if (!/\.html/i.test(f)) return;
console.log('######## Processing file...', f);
cleanFile(dir + f, '', function(result) {
results.push({time: result.time, file: f, inputLength: result.inputLength, error: result.error});
Oops, something went wrong.

0 comments on commit 76ce9d3

Please sign in to comment.