lychee/lychee-lib
Matthias Endler 11adc09725
Don't check preconnect links (#1187)
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
2024-10-07 22:36:16 +02:00
..
src Don't check preconnect links (#1187) 2024-10-07 22:36:16 +02:00
Cargo.toml Don't check preconnect links (#1187) 2024-10-07 22:36:16 +02:00
LICENSE-APACHE Major refactor of codebase (#208) 2021-04-15 01:24:11 +02:00
LICENSE-MIT Update license files (#497) 2022-02-08 10:59:54 +01:00