XPath to CSS in Rust https://crates.io/crates/cssifier
Go to file
kirbylife 8b3cd1ed81 makes clippy happy 2021-03-25 19:03:05 -06:00
src makes clippy happy 2021-03-25 19:03:05 -06:00
.gitignore Initial commit 2021-03-07 18:50:42 -06:00
Cargo.toml Fix tests on comments and now accept &str and String 2021-03-21 01:29:10 -06:00
README.md fix bug in 'contains' condition and add doc 2021-03-14 17:57:02 -06:00

README.md

CSSIFIER_RS

Simple crate to convert XPath selectors to CSS selectors

based on cssify but rewrited in Rust (RiiR FTW).

dependencies:

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

  • bug in 'contains' condition
  • invalid XPath return empty String
  • Compatible with WASM

Contributors are welcome :).