feat: support paste html

This commit is contained in:
Lucas.Xu 2023-05-31 16:05:49 +08:00
commit 839bb94cba

View file

@ -97,6 +97,18 @@ class _HomePageState extends State<HomePage> {
final jsonString = rootBundle.loadString('assets/example.json');
_loadEditor(context, jsonString);
}),
_buildListTile(context, 'With Example.html', () async {
final htmlString =
await rootBundle.loadString('assets/example.html');
final html = htmlToDocument(htmlString);
// final html = HTMLToNodesConverter(htmlString).toDocument();
final jsonString = Future<String>.value(
jsonEncode(
html.toJson(),
).toString(),
);
_loadEditor(context, jsonString);
}),
_buildListTile(context, 'With Empty Document', () {
final jsonString = Future<String>.value(
jsonEncode(