Skip to content

Non-elements between adjacent and general sibling combinators should be skipped #3

Closed
@wooorm

Description

@wooorm

This does not work:

    st.deepEqual(
      select(
        'h1 + p',
        u('root', [
          u('text', '\n'),
          h('p', 'Alpha'),
          u('text', '\n'),
          h('h1', 'Bravo'),
          u('text', '\n'),
          h('p', 'Charlie'),
          u('text', '\n'),
          h('p', 'Delta'),
          u('text', '\n'),
          h('div', [h('p', 'Echo')])
        ])
      ),
      h('p', 'Charlie'),
      'should return adjacent sibling (whitespace)'
    )

It does work if there is no inter-element whitespace.

Affects +, but probably also ~ and >

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions