Skip to content

Commit dcb9bd2

Browse files
committed
Ignore unsupported style selectors
1 parent 79cdfdf commit dcb9bd2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/html_parser.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,11 @@ class HtmlParser extends StatelessWidget {
242242

243243
static StyledElement _applyExternalCss(Map<String, Map<String, List<css.Expression>>> declarations, StyledElement tree) {
244244
declarations.forEach((key, style) {
245-
if (tree.matchesSelector(key)) {
246-
tree.style = tree.style.merge(declarationsToStyle(style));
247-
}
245+
try {
246+
if (tree.matchesSelector(key)) {
247+
tree.style = tree.style.merge(declarationsToStyle(style));
248+
}
249+
} catch (_) {}
248250
});
249251

250252
tree.children.forEach((e) => _applyExternalCss(declarations, e));

0 commit comments

Comments
 (0)