* refactor: move AsciiSet related code to ascii_set.rs
Makes it a little easier to just look at the code related to the set rather than encoding
* Add tests for percent_encoding
* Add AsciiSet::EMPTY and impl ops::Add for AsciiSet
In RFCs, the sets of characters to percent-encode are often defined as
the union of multiple sets. This change adds an `EMPTY` constant to
`AsciiSet` and implements the `Add` trait for `AsciiSet` so that sets
can be combined with the `+` operator.
AsciiSet now derives `Debug`, `PartialEq`, and `Eq` so that it can be
used in tests.
* implement ops::Not for AsciiSet
* Add const functions for negation / union of AsciiSet
* Revert "Reimplement idna on top of ICU4X (#923)"
This reverts commit 3d6dbbb1df.
See #937 for reasons behind this backout.
* Bump url version to 2.5.2
* Pin unicode-width to 0.1.12 to avoid build failure in rust 1.56
* Remove ambiguous_wide_pointer_comparisons to maybe resolve clippy error
* fix clippy
* reproduce a panic when parsing a specific URL
Details can be found here: https://github.com/Byron/gitoxide/issues/1401
* fix overflow when processing punycode encoded URLs like `xn--55555577`
* fix clippy error
* Reimplement idna on top of ICU4X
* Add an even faster lower-case ASCII letter path to avoid regressing performance
* Comments and verify_dns_length tweak
* Parametrize internal vs. external Punycode caller; restore external API behavior
* Add bench for to_ascii on an already-Punycode name
* Avoid re-encoding Punycode when possible
* Pass through the input slice in many more cases
* Add testing for the simultaneous mode
* Omit the invalid domain character check on the url side
* Document that Punycode labels must result in non-ASCII
* Rename files called uts46.rs to deprecated.rs
* Rename uts46bis to uts46
* Tweak docs
* Avoid useless copying and useless UTF-8 decode
* Use inline(never) to optimize binary size
* Split CheckHyphens into a separate concern form the ASCII deny list
* Make the ASCII deny list customizable
* Better docs and top-level functions
* Parameter for VerifyDNSLength
* Restore support for transitional processing to minimize breakage
* In the deprecated API, use empty deny list with use_std3_ascii_rules=false
* Tweak docs
* Docs, rename AsciiDenyList::WHATWG to ::URL, tweak top-level functions
* Use idna crate top-level function in the url crate to dogfood the top-level function
* Add an Usage section to the README
* Add an early return to map_transitional for readability
* Document internal vs. external Punycode caller differences
* Per discussion with Valentin, revert deprecated API to the old behavior that does not check hyphens in positions 3 and 4
* Add comments about not fixing deprecated API
* Add a comment explaining FailFast in deprecated.rs
* For future-proofing, add compiled_data cargo feature (currently always required)
Since other changes in this changeset require a semver break anyway, this
change takes a semver break in the case of `default-features = false` in
order to avoid a future semver break if in the future a need to add a
bring-your-own-data (using `icu_provider`) constructor for `Uts46`
shows up.
* Remove remark about spec violation by making root dot permissibility configurable
* Clarify README about IDNA 2003/2008
* Add a historical remark to the README
* Fix typo
* Depend on crates.io versions of icu_normalizer and icu_properties
* Address clippy lints
* Update versions
* Increment dependency versions
* remove `Url::socket_addrs` on wasm32-unknown-unknown (it won't work, those
platform API calls are not supported)
* disable unit tests which won't work on wasm32-unknown-unknown
* run tests in `wasm_bindgen_test` on wasm32-unknown-unknown
* remove `panic::catch_unwind` from wpt tests, as that conflicts with
wasm-bindgen's panic handler
* run the tests in CI
When writing accumulated "non-special" characters, `slice_start` must be
updated as some later conditionals/pattern matches don't update it like
the case when `%` is not followed by 2 hex digits.
This fixes#795
The sentence in question was clearly intended to remark that the leading
slash in the path is part of said path, but due to the missing "e" at
the end of "Note", it (ungrammatically) says the opposite.
Co-authored-by: Maeve Sproule <code@sprock.dev>
This commit implements std::error::Error for errors in the `data-url`
crate. This commit does not implement `Error` on `DecodeError` because
there is no trait bound for `Error` on the `E` type argument of
`DecodeError`.
To prevent having to raise MSRV again, we move the debugger_visualizer
to a separate crate. This crate is only compiled when the feature
`debugger_visualizer` is enabled, because only then the
`debugger_visualizer` test is added as a compile target.