Skip to main content

Module parse

Module parse 

Source
Expand description

Shared low-level parsing helpers — not glob-re-exported because its items are meant to be used via qualified paths. CSS string parsing utilities: parenthesized expressions, quote stripping, comma/whitespace-aware splitting that respects nesting depth, and CSS image/url path parsing.

Structs§

QuoteStripped
A string that has been stripped of the beginning and ending quote
UnclosedQuotesError
String has unbalanced ' or " quotation marks

Enums§

CssImageParseError
CssImageParseErrorOwned
Owned version of CssImageParseError.
ParenthesisParseError
ParenthesisParseErrorOwned
Owned version of ParenthesisParseError.

Functions§

parse_image
A string slice that has been stripped of its quotes. In CSS, quotes are optional in url() so we accept both quoted and unquoted strings.
parse_parentheses
Checks whether a given input is enclosed in parentheses, prefixed by a certain number of stopwords.
split_string_respect_comma
Splits a string by commas, but respects parentheses/braces
split_string_respect_whitespace
Splits a string by whitespace, but respects parentheses/braces
strip_quotes
Strip quotes from an input, given that both quotes use either " or ', but not both.