mirror of
https://github.com/Hopiu/lychee.git
synced 2026-04-02 12:40:26 +00:00
Preconnect links are used to establish a server connection without loading a specific resource yet. Not always do these links point to a URL that should return a 200, and they are not user-facing, i.e. they don't show up in the final rendered version of a page. Therefore, we should not check them at all; not even in `--include-verbatim` mode, as they might not point to a valid resource. This turned out to require a significant overhaul of the html5gum extractor to handle random attribute ordering correctly. Changes to the html5gum extractor: * Refactor HTML link extractor for improved performance and maintainability - Replace Vec<u8> with String for better readability and manipulation - Introduce Element struct to encapsulate element-related data - Use `HashMap<String, String>` for current_attributes for efficient lookups - Add verbatim_stack to properly handle nested verbatim elements - Remove unsafe code where possible, using String::from_utf8_lossy - Improve attribute handling with `HashMap` entry API and prioritize `srcset` - Simplify logic and consolidate verbatim element handling - Enhance encapsulation in `LinkExtractor` struct - Improve overall performance with more efficient data structures - Increase flexibility for future feature additions or modifications Fixes #897 |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||