-
-
Notifications
You must be signed in to change notification settings - Fork 929
Closed
Description
Originally reported on the mailing list by @MaxLustig and at #1853 which was self-closed.
Failing example:
#! /usr/bin/env ruby
require 'nokogiri'
html = <<-EOHTML
<div class="section header" id=1>
<div class="subsection header">sub 1</div>
<div class="subsection header">sub 2</div>
</div>
<div class="section header" id=2>
<div class="subsection header">sub 3</div>
<div class="subsection header">sub 4</div>
</div>
EOHTML
doc = Nokogiri::HTML.fragment html
parent = doc.at_css("body")
x = parent > ".header"
# /home/flavorjones/foo.rb:22:in `<main>': undefined method `>' for nil:NilClass (NoMethodError)We should move the definition of Node#> into Searchable and make sure it works for DocumentFragment. I'll further note that that implementation might be fraught because of the well-documented xpath-on-root-nodes issues (see #572), but this is essentially a failing test that we need to make work at some point.