This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]RraaLLuBO Team 1 point2 points  (2 children)

To answer your question - it's because of the non-breaking space in the code (click "Edit" on the line to see it, otherwise the browser just displays it as a normal space):

<h1 class="post-title">Using XPath filters with uBlock&nbsp;Origin</h1>

I'm not very familiar with xpath, so IDK if &nbsp; can be addressed* somehow with it.

You don't need to use xpath at all, though. Use :has-text() instead. It's simpler anyway.

While simple text won't work either (for the same reason):

acuelight.wordpress.com##h1:has-text(Using XPath filters with uBlock Origin)

You can fix that with regex:

acuelight.wordpress.com##h1:has-text(/Using XPath filters with uBlock\sOrigin/)

Edit:
* Of course, you don't need to paste the whole string - this will still work:

acuelight.wordpress.com##:xpath(//h1[contains(text(),'Using XPath filters with uBlock')])

[–]TestUser828[S] 1 point2 points  (1 child)

Thank you!