Code Monkey home page Code Monkey logo

Comments (5)

fefit avatar fefit commented on August 15, 2024

@Random-G the behavior of the html() and text() method just follow the jquery do, i don't know why jquery design like that, because sometimes it's indeed confusing. now if you want to get the combined html of all the elements, you may do like this:

let html = "<div><span>1<span></div><div><span>2</span></div>";
let root = Vis::load(html)?;
let divs = root.find("div");
let all_div_html = divs.map(|_, ele| ele.html()).join(""); // <span>1<span><span>2</span>

it need to write some more code, if it's a common need, maybe we can add a sugar method html_all() or other names whaterver for this purpose, do you have any good idea?

from visdom.

Random-G avatar Random-G commented on August 15, 2024

@fefit Thank you very much for your response. html_all() or htmls() sounds good.

from visdom.

fefit avatar fefit commented on August 15, 2024

@Random-G htmls() sounds great! i will append the htmls() and outer_htmls() methods in the new version, thanks for your advice and feedback!

from visdom.

fefit avatar fefit commented on August 15, 2024

the new version v0.5.6 has published to resolve this~

from visdom.

Random-G avatar Random-G commented on August 15, 2024

@fefit Thank you very much for the update.

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.