Skip to content

:last css selector not working in DocumentFragment #454

Closed

Description

@brain-geek

Test to reproduce bug:

  def test_last_fragment
    text = '<p>Lorem ipsum</p><p>Second paragraph</p><div>Not paragraph</div>'
    fragment = Nokogiri::HTML.fragment text

    assert_equal(1, fragment.search('p:last').size)
    assert_equal(1, fragment.css('p:last').size)
  end

Looks like this works with document, but fails in fragment.

Activity

  1. flavorjones commented on May 10, 2011

    @flavorjones
    Member

    This is a dup of either #213 or #370.

  2. self-assigned this
    on Dec 31, 2014
  3. flavorjones commented on Jan 2, 2015

    @flavorjones
    Member

    Folding this into #572, the underlying issue is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions