Skip to content

:not() ? #4

@greg-minshall

Description

@greg-minshall

hi. thanks for this utility.

i'm trying to use the :not() pseudo-class, but either i'm using it incorrectly, i misunderstand how it works, or it isn't working. (i'm basicaly looking for a grep -v version, to produce a .html file that does not have a given element.)

1218, the "positive" version, is the typical use, and works fine. 1219, still "positive", makes me think i don't understand -- why are things duplicated? 1220 and 1221 are the negative form, but <div>s still appear on the output.

bash apollo2 (master): {1218} echo '<div>this is a test</div><a href=foo.com>' | hq 'div' data
<div>this is a test</div>

bash apollo2 (master): {1219} echo '<div>this is a test</div><a href=foo.com>' | hq '*' data
<html><head></head><body><div>this is a test</div><a href="foo.com">
</a></body></html>
<head></head>
<body><div>this is a test</div><a href="foo.com">
</a></body>
<div>this is a test</div>
<a href="foo.com">
</a>

bash apollo2 (master): {1220} echo '<div>this is a test</div><a href=foo.com>' | hq '*:not(div)' data
<html><head></head><body><div>this is a test</div><a href="foo.com">
</a></body></html>
<head></head>
<body><div>this is a test</div><a href="foo.com">
</a></body>
<a href="foo.com">
</a>

bash apollo2 (master): {1221} echo '<div>this is a test</div><a href=foo.com>' | hq ':not(div)' data
<html><head></head><body><div>this is a test</div><a href="foo.com">
</a></body></html>
<head></head>
<body><div>this is a test</div><a href="foo.com">
</a></body>
<a href="foo.com">
</a>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions