From 16c828f5c6bf55336d36e0b7e1f747eda84edbb7 Mon Sep 17 00:00:00 2001 From: Zak Barbuto Date: Wed, 6 Oct 2021 16:34:27 +1030 Subject: [PATCH] Ignore unsupported custom styles --- lib/html_parser.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/html_parser.dart b/lib/html_parser.dart index 9818157fd2..48e7027989 100644 --- a/lib/html_parser.dart +++ b/lib/html_parser.dart @@ -273,9 +273,11 @@ class HtmlParser extends StatelessWidget { /// widget onto the [StyledElement] tree, no cascading of styles is done at this point. static StyledElement _applyCustomStyles(Map style, StyledElement tree) { style.forEach((key, style) { - if (tree.matchesSelector(key)) { - tree.style = tree.style.merge(style); - } + try { + if (tree.matchesSelector(key)) { + tree.style = tree.style.merge(style); + } + } catch (_) {} }); tree.children.forEach((e) => _applyCustomStyles(style, e));