Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 8bbb906c5aa80d7571ae27c31682eaf8bc40df9c 1 parent b822d67
Motohiro Takayama mootoh authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 mkindex.js
5 mkindex.js
@@ -11,6 +11,7 @@ var fs = require('fs'),
11 11 Url = require('url'),
12 12 querystring = require('querystring'),
13 13 crypto = require('crypto'),
  14 + libxml = require('libxmlext'),
14 15 undefined;
15 16
16 17 var srcdb = new DB('docs.db');
@@ -52,8 +53,8 @@ SourcePath.prototype = {
52 53 },
53 54 getESVersion: function () { // ecmascript version
54 55 var src = this.getContent();
55   - var q = nquery.createHtmlDocument(src);
56   - var h = q('.standard-table').html();
  56 + var doc = libxml.parseHtmlString(src);
  57 + var h = doc.root().find("//table[@class='standard-table']").toString();
57 58 var version = null;
58 59 if (h) {
59 60 var matched = h.match(new RegExp('<td>ECMAScript Edition</td>[\s\n ]*<td>([^<]+)</td>'));

0 comments on commit 8bbb906

Please sign in to comment.
Something went wrong with that request. Please try again.