daohoangson / flutter_widget_from_html

Flutter package to render html as widgets that supports hyperlink, image, audio, video, iframe and many other tags.
https://pub.dev/packages/flutter_widget_from_html
MIT License
602 stars 217 forks source link

type 'Null' is not a subtype of type 'LiteralTerm' in type cast #1287

Open javier-gantri opened 2 weeks ago

javier-gantri commented 2 weeks ago

Steps to Reproduce

HTML ```html Some invalid CSS like
, for context, I'm trying to parse some emails sent using external tools that sometimes generate some invalid CSS selector. ```
`HtmlWidget` configuration ```dart HtmlWidget( content, buildAsync: true, onErrorBuilder: (context, element, error) { return const Text('Error parsing the message!'); }, ), ```
Tesing environment ``` ```

Expected results

don't show the red x icon, and discard invalid HTML and CSS.

Actual results

show a red x icon

daohoangson commented 1 week ago

I can't reproduce this bug with the provided HTML. Can you provide the full HTML that is triggering this bug? Also, an error stack would be useful.