Skip to content

Subsequent-sibling combinator (~) support #230

Closed

Description

@nfriedly

Hi, thanks for this library!

I'd like to request support for the subsequent-sibling combinator (~).

It's similar to the next sibling combinator (+), except it selects all of the sibling elements that match the right side and come after the left side match, not just the first sibling after a left-side match.

For example, if you have:

<p>one</p>
<img src="foo">
<p>two</p>
<p>three</p>

The selector img + p would match the "two" paragraph (I believe CssXPath already handles this correctly).

Then the selector img ~ p would match the "two" and "three" paragraphs. (Currently CssXPath fails to match anything.)

See https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Combinators#subsequent-sibling_combinator for more info.

I'd like to use this in FreshRSS to filter out a bunch of junk that gets shoved into the end of every article in one of my feeds.

(I'd really like support for the :contains("Your ad here!") pseudoclass, but I figured this one was an actual standard, so it'd be a better request to start with :)

Activity

  1. added a commit that references this issue on Oct 22, 2025
  2. Alkarex commented on Oct 22, 2025

    @Alkarex
    Contributor

    @nfriedly Tests welcome #231

  3. added a commit that references this issue on Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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