fefit / rphtml Goto Github PK
View Code? Open in Web Editor NEWA html parser written in RUST, parse html into node trees.
License: MIT License
A html parser written in RUST, parse html into node trees.
License: MIT License
Need change the "Rc" to "Weak".
Hi there,
htmlentity
changed its API in the newly released version 1.3.0. rphtml
pulls that dependency in "1.2.0"
which allows cargo to update the dependency to this version. That means rphtml
wont compile any longer. From a freshly checked out repository:
$ cargo build
Updating crates.io index
Compiling proc-macro2 v1.0.56
Compiling quote v1.0.26
Compiling unicode-ident v1.0.8
Compiling thiserror v1.0.40
Compiling anyhow v1.0.70
Compiling lazy_static v1.4.0
Compiling syn v2.0.15
Compiling thiserror-impl v1.0.40
Compiling htmlentity v1.3.0
Compiling rphtml v0.5.8 (/Users/ckruse/rphtml)
error[E0432]: unresolved imports `htmlentity::entity::encode_chars`, `htmlentity::entity::EntitySet`
--> src/parser.rs:6:43
|
6 | use htmlentity::entity::{decode_chars_to, encode_chars, EncodeType, Entity, EntitySet};
| ^^^^^^^^^^^^ ^^^^^^^^^ no `EntitySet` in `entity`
| |
| no `encode_chars` in `entity`
|
help: a similar name exists in the module
|
6 | use htmlentity::entity::{decode_chars_to, encode_char, EncodeType, Entity, EntitySet};
| ~~~~~~~~~~~
help: a similar name exists in the module
|
6 | use htmlentity::entity::{decode_chars_to, encode_chars, EncodeType, Entity, Entity};
| ~~~~~~
error[E0308]: mismatched types
--> src/parser.rs:569:47
|
569 | ... if let Some(decoded) = Entity::decode(entity) {
| -------------- ^^^^^^ expected `u8`, found `char`
| |
| arguments to this function are incorrect
|
= note: expected reference `&[u8]`
found reference `&[char]`
note: associated function defined here
--> /Users/ckruse/.cargo/registry/src/github.com-1ecc6299db9ec823/htmlentity-1.3.0/src/entity.rs:838:10
|
838 | pub fn decode(bytes: &[Byte]) -> AnyhowResult<char> {
| ^^^^^^
error[E0308]: mismatched types
--> src/parser.rs:569:16
|
569 | ... if let Some(decoded) = Entity::decode(entity) {
| ^^^^^^^^^^^^^ ---------------------- this expression has type `Result<char, anyhow::Error>`
| |
| expected enum `Result`, found enum `Option`
|
= note: expected enum `Result<char, anyhow::Error>`
found enum `Option<_>`
Some errors have detailed explanations: E0308, E0432.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `rphtml` due to 3 previous errors
Can you please adopt the changes and increase the minimum version?
Best regards,
CK
In rust if we panicked, everything's break. There's no way to work around that, at least in straightforward manners.
Since it's a library, the user cannot predictably do stuff safely because the library can panic and user cannot handle it at all
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.