v2 icon indicating copy to clipboard operation
v2 copied to clipboard

Cannot use css has adjacent sibling combinator matching rules in rewrite rules to remove dom elements

Open NavyD opened this issue 2 years ago • 1 comments

In this feed , I need to select the h2 element adjacent to p to remove, the css rule is h2:has(+p), and the following is part of the html content:

<h2>S3 Storage (Long-term availability not guaranteed)</h2>
<p>https://release.dreamacro.workers.dev/</p>
<h2>Changelog</h2>
<h3>2023.03.18</h3>
<ul>
    <li>upgrade to 1.14.0</li>
    <li>improve Linux TCP upload throughput @Kr328</li>
    <li>fix <code>auto-detect-interface</code> TUN loopback on Windows in some cases @Kr328</li>
</ul>

I try to fill in remove("h2:has(+p)") directly in rewrite rules, but it doesn't seem to have any effect.

miniflux Version: 2.0.43

NavyD avatar Mar 19 '23 03:03 NavyD

I'm also having this issue, but for me its when trying to remove subscribe now links from substacks. I tried adding remove("p:has(a[href$='.substack.com/subscribe?'])") but it doesn't work, and I believe its due to :has not being implemented.

thepaperpilot avatar Apr 21 '25 18:04 thepaperpilot

This feature does not appear to be supported by GoQuery/Cascadia librairies.

To answer the first comment, you might be able to achieve what you want using h2:first-of-type.

fguillot avatar Aug 02 '25 01:08 fguillot