mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Return OptionalNone from DOMURL::parse on failure
This ports one more function away from needing to use the awkward valid state of the URL class.
This commit is contained in:
parent
b81d6945dc
commit
fd27eef0d1
Notes:
github-actions[bot]
2025-01-22 12:34:57 +00:00
Author: https://github.com/shannonbooth
Commit: fd27eef0d1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3339
Reviewed-by: https://github.com/AtkinsSJ ✅
18 changed files with 63 additions and 65 deletions
|
@ -286,9 +286,7 @@ String SourceHighlighterClient::to_html_string(URL::URL const& url, URL::URL con
|
|||
auto attribute_url = MUST(String::formatted("{}", attribute_value));
|
||||
auto attribute_url_without_quotes = attribute_url.bytes_as_string_view().trim("\""sv);
|
||||
|
||||
if (auto resolved = Web::DOMURL::parse(attribute_url_without_quotes, base_url); resolved.is_valid())
|
||||
return resolved;
|
||||
return {};
|
||||
return Web::DOMURL::parse(attribute_url_without_quotes, base_url);
|
||||
};
|
||||
|
||||
size_t span_index = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue