You can subscribe to get when the following pull request is being approved.
Meanwhile I recommend you to apply the solution in your downloaded x-ray module. It's one line code and I tested in two projects, it simply works. Take a look at the index.js file at line 237 see "return" after the long comment:
function WalkHTML (xray, selector, scope, filters) {
return function walkHTML ($, fn) {
walk(selector, function (v, k, next) {
if (typeof v === 'string') {
var value = resolve($, root(scope), v, filters)
return next(null, value)
} else if (typeof v === 'function') {
return v($, function (err, obj) {
if (err) return next(err)
return next(null, obj)
})
} else if (isArray(v)) {
if (typeof v[0] === 'string') {
return next(null, resolve($, root(scope), v, filters))
} else if (typeof v[0] === 'object') {
var $scope = $.find ? $.find(scope) : $(scope)
var pending = $scope.length
var out = []
// Handle the empty result set (thanks @jenbennings!)
if (!pending) return next(null, out)
$scope.each(function (i, el) {
var $innerscope = $scope.eq(i)
var node = xray(scope, v[0])
node($innerscope, function (err, obj) {
if (err) return next(err)
out[i] = obj
if (!--pending) {
return next(null, compact(out))
}
})
})
// Nested crawling broken on 'master'. When to merge 'bugfix/nested-crawling' #111, Needed to exit this without calling next, the problem was that it returned to the "finished" callback before it had retrived all pending request. it should wait for "return next(null, compact(out))"
return
}
}
return next()
}, function (err, obj) {
if (err) return fn(err)
fn(null, obj, $)
})
}
}