Class CssSelectorParser
java.lang.Object
dev.jcputney.mjml.css.CssSelectorParser
Recursive-descent parser for CSS selectors.
Grammar (simplified):
selector-list = complex-selector (',' complex-selector)*
complex-selector = compound-selector (combinator compound-selector)*
combinator = ' ' | '>' | '+' | '~'
compound-selector = simple-selector+
simple-selector = type | universal | class | id | attribute | pseudo
-
Method Summary
Modifier and TypeMethodDescriptionstatic CssSelectorParses a selector string into a CssSelector tree.
-
Method Details
-
parse
Parses a selector string into a CssSelector tree.- Parameters:
selectorText- the CSS selector text- Returns:
- the parsed selector, or null if parsing fails
-