Comments (5)
@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.
@fefit Thank you very much for your response. html_all()
or htmls()
sounds good.
from visdom.
@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.
the new version v0.5.6 has published to resolve this~
from visdom.
@fefit Thank you very much for the update.
from visdom.
Related Issues (20)
- error: failed to get `mesdoc` as a dependency of package `visdom v0.1.4 HOT 1
- How to remove a DOM element? HOT 6
- No problem, my bad :(
- Navigating sideway with `find` method HOT 2
- set_html and replace_with seems not work HOT 6
- 这么好的项目为什么这么少人知道? HOT 1
- 不可用 HOT 2
- `rphtml` and `htmlentities` APIs changed HOT 3
- Stripping class entirely HOT 2
- Does this support xpath selectors ? HOT 4
- 带:冒号的怎么解析? HOT 9
- 缺少类似jquery的clone HOT 6
- `Vis::load`返回的结果应该自动选中root元素 HOT 2
- 内存泄漏 HOT 6
- 如何获取节点的tag name(节点名称)? HOT 3
- 将`Result<Elements, Box<dyn Error>>` 改为`Result<Elements, Box<dyn Error + Send>>` HOT 2
- 是否有更好的方式获取 select 元素的值? HOT 4
- Opposite of .has() HOT 4
- doc.find("p:contains('好用')" panicked, only when Chinese characters appear in contains() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visdom.