Code Monkey home page Code Monkey logo

Comments (4)

fefit avatar fefit commented on August 15, 2024 1

Sorry, there's no method opposite to thehas() method yet. Currently you may need do such thing like below:

let html = r#"
    <div><p></p></div>
    <div></div>
    <div></div>
"#;
let root = Vis::load(html)?;
let divs = root.find("div");
let divs_has_p = divs.has("p");
let divs_not_has_p = divs.not_in(&div_has_p);

I think i should add the :has pseudo selector, so you can do this by a simpler way:

let div_not_has_p = divs.not(":has(p)");

I will add that later, thx for your feedback.

from visdom.

rrjanbiah avatar rrjanbiah commented on August 15, 2024

@fefit Thank you so much for your quick reply. Much appreciated!

from visdom.

fefit avatar fefit commented on August 15, 2024

@rrjanbiah The :has pseudo selector has been added in the new version 0.5.2, examples can be seen in the test case function test_selector_pseudo_has https://github.com/fefit/visdom/blob/main/tests/selector.rs#L829. Thx again for your feedback :)

from visdom.

rrjanbiah avatar rrjanbiah commented on August 15, 2024

@fefit So fast.. thank you so much for the great library!

from visdom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.