diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json deleted file mode 100644 index 7691f75..0000000 --- a/.fvm/fvm_config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "flutterSdkVersion": "3.19.2", - "flavors": {} -} \ No newline at end of file diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 0000000..b231bd0 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,4 @@ +{ + "flutter": "3.19.4", + "flavors": {} +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3dd299b..3a52571 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,5 @@ unlinked.ds unlinked_spec.ds app.*.symbols -# FVM -.fvm/flutter_sdk +# FVM Version Cache +.fvm/ diff --git a/lib/html/seo_controller.dart b/lib/html/seo_controller.dart index 782bb06..0fdba1f 100644 --- a/lib/html/seo_controller.dart +++ b/lib/html/seo_controller.dart @@ -64,7 +64,7 @@ class _SeoControllerState extends State { final _bodyValidator = NodeValidatorBuilder() ..allowHtml5(uriPolicy: _AllowAllUriPolicy()) - ..allowCustomElement('flt-seo') + ..allowCustomElement('div', attributes: ['flt-seo']) ..allowCustomElement('noscript') ..allowCustomElement('h1', attributes: ['style']) ..allowCustomElement('h2', attributes: ['style']) @@ -147,11 +147,12 @@ class _SeoControllerState extends State { if (_bodyHash == hash) return; _bodyHash = hash; - body.children.removeWhere((element) => element.localName == 'flt-seo'); + body.children + .removeWhere((element) => element.attributes.containsKey('flt-seo')); body.insertAdjacentHtml( 'afterBegin', - '${html.body}', + '
${html.body}
', validator: _bodyValidator, ); } diff --git a/test/base.dart b/test/base.dart index 438c6b7..9e8a512 100644 --- a/test/base.dart +++ b/test/base.dart @@ -14,7 +14,7 @@ String? get headHtml => document.head?.children .join('\n'); String? get bodyHtml => document.body?.children - .firstWhereOrNull((element) => element.localName == 'flt-seo') + .firstWhereOrNull((element) => element.attributes.containsKey('flt-seo')) ?.innerHtml; Duration measure(T Function() measure) {