cssifier/README.md

29 lines
572 B
Markdown
Raw Permalink Normal View History

2021-03-08 01:48:08 +00:00
# CSSIFIER_RS
## Simple crate to convert XPath selectors to CSS selectors
2021-03-08 02:41:24 +00:00
based on [cssify](https://github.com/santiycr/cssify) but rewrited in Rust (RiiR FTW).
2021-03-08 01:48:08 +00:00
### dependencies:
- [Regex](https://crates.io/crates/regex)
### Usage
The usage is simple:
```
cssifier("//a/b")
// Some("a b")
cssifier("//a/b[@id='hello']")
// Some(a b#hello)
cssifier("//a/b[contains(text(), 'hello')]")
// Some(a b:contains(hello))
```
### Known issues
- [x] bug in 'contains' condition
2021-03-08 22:01:19 +00:00
- [ ] invalid XPath return empty String
- [ ] Compatible with WASM
2021-03-08 01:48:08 +00:00
Contributors are welcome :).