Skip to main content

parse_one_url

Function parse_one_url 

Source
fn parse_one_url(remaining: &str) -> Result<(&str, Option<&str>), String>
Expand description

Implements one iteration of the “splitting loop” from the reference algorithm. This is intended to be repeatedly called until the remaining string is empty.

Returns a tuple of remaining string and an optional parsed URL, if successful. Otherwise, in case of srcset syntax errors, returns Err.

https://html.spec.whatwg.org/multipage/images.html#parsing-a-srcset-attribute