Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.79k stars 860 forks source link

[BUG] Impossible to print dart code if it contains any <class> #1294

Closed bsoft00 closed 1 year ago

bsoft00 commented 1 year ago

Describe the bug:

I want to print on a html widget some dart code. But each time, the code only prints a part of it. It stops each time at something like : class _RandomTextPageState extends State**<RandomTextPage>** The <Rand.. part is always cut, and nothing more is printed. Same thing whatever the name of the state...

Html widget configuration:

SelectionArea(
                        child:
                          Html(
                            data: htmldata, 
                            onLinkTap: (String? url, Map<String, String> attributes, dom.Element? element) {
                              Uri localurl = Uri.parse(url.toString());
                              debugPrint("tap url : $message.url");
                              launchUrl(localurl);
                            },
                            style: {
                              "body": Style(color: const Color.fromRGBO(0, 0, 0,1), fontSize: FontSize.large)  
                            }
                          ),
                      ),

Device details and Flutter/Dart/flutter_html versions: Last flutter/dart version and flutter html 3b1

Sub6Resources commented 1 year ago

This is html, so you'll need to escape < and > characters in your code using &lt; and &gt; respectively.