Permalink
Browse files

Fixes indexing failure in mkindex.js

nquery v0.1.3 fails in createTextNode() function like below,
that prevents jsapi from creating index.

    TypeError: Cannot call method 'remove' of undefined
        at createTextNode
        (/src/jsapi/node_modules/nquery/lib/dominiq.js:89:10)
        ...
  • Loading branch information...
1 parent b822d67 commit 8bbb906c5aa80d7571ae27c31682eaf8bc40df9c @mootoh mootoh committed Jan 15, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 mkindex.js
View
5 mkindex.js
@@ -11,6 +11,7 @@ var fs = require('fs'),
Url = require('url'),
querystring = require('querystring'),
crypto = require('crypto'),
+ libxml = require('libxmlext'),
undefined;
var srcdb = new DB('docs.db');
@@ -52,8 +53,8 @@ SourcePath.prototype = {
},
getESVersion: function () { // ecmascript version
var src = this.getContent();
- var q = nquery.createHtmlDocument(src);
- var h = q('.standard-table').html();
+ var doc = libxml.parseHtmlString(src);
+ var h = doc.root().find("//table[@class='standard-table']").toString();
var version = null;
if (h) {
var matched = h.match(new RegExp('<td>ECMAScript Edition</td>[\s\n ]*<td>([^<]+)</td>'));

0 comments on commit 8bbb906

Please sign in to comment.