From eb9845f9c4f38326b6ef3f4a92eeb038e087d95a Mon Sep 17 00:00:00 2001 From: Matthew Whitaker Date: Tue, 11 Mar 2025 20:30:31 -0600 Subject: [PATCH 1/3] fix: Corrected README imports (#1469) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bbcb74c0f5..adea04a977 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Add the dependency to your pubspec.yaml: flutter pub add flutter_html_audio ```dart -import 'package:flutter_html_audio/flutter_html_audio'; +import 'package:flutter_html_audio/flutter_html_audio.dart'; Widget html = Html( data: myHtml, @@ -168,7 +168,7 @@ Add the dependency to your pubspec.yaml: flutter pub add flutter_html_iframe ```dart -import 'package:flutter_html_iframe/flutter_html_iframe'; +import 'package:flutter_html_iframe/flutter_html_iframe.dart'; Widget html = Html( data: myHtml, @@ -195,7 +195,7 @@ Add the dependency to your pubspec.yaml: flutter pub add flutter_html_math ```dart -import 'package:flutter_html_math/flutter_html_math'; +import 'package:flutter_html_math/flutter_html_math.dart'; Widget html = Html( data: myHtml, @@ -256,7 +256,7 @@ Add the dependency to your pubspec.yaml: flutter pub add flutter_html_svg ```dart -import 'package:flutter_html_svg/flutter_html_svg'; +import 'package:flutter_html_svg/flutter_html_svg.dart'; Widget html = Html( data: myHtml, @@ -279,7 +279,7 @@ Add the dependency to your pubspec.yaml: flutter pub add flutter_html_table ```dart -import 'package:flutter_html_table/flutter_html_table'; +import 'package:flutter_html_table/flutter_html_table.dart'; Widget html = Html( data: myHtml, @@ -302,7 +302,7 @@ Add the dependency to your pubspec.yaml: flutter pub add flutter_html_video ```dart -import 'package:flutter_html_video/flutter_html_video'; +import 'package:flutter_html_video/flutter_html_video.dart'; Widget html = Html( data: myHtml, From d46cfde86279e016d38a079a5bbf43ce2206d6a2 Mon Sep 17 00:00:00 2001 From: Matthew Whitaker Date: Tue, 11 Mar 2025 22:38:11 -0600 Subject: [PATCH 2/3] fix: Fix text-transform inheritance (#1470) --- lib/src/style.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/style.dart b/lib/src/style.dart index e605ee43fa..d19fede664 100644 --- a/lib/src/style.dart +++ b/lib/src/style.dart @@ -228,6 +228,12 @@ class Style { /// TextOverflow? textOverflow; + /// CSS Attribute "`text-transform`" + /// + /// `uppercase`, `lowercase`, `capitalize`, and `none` supported. + /// + /// Inherited: yes, + /// Default: `none` TextTransform? textTransform; Style({ @@ -268,7 +274,7 @@ class Style { this.alignment, this.maxLines, this.textOverflow, - this.textTransform = TextTransform.none, + this.textTransform, }) { if (alignment == null && (display?.isBlock ?? false)) { alignment = Alignment.centerLeft; From c182a3121f54259b92d7dcd01b584f22f04bc8de Mon Sep 17 00:00:00 2001 From: Wolfgang Haupt Date: Wed, 12 Mar 2025 22:31:31 +0100 Subject: [PATCH 3/3] fix: fix text decoration regressions (#1448) --- lib/src/builtins/interactive_element_builtin.dart | 1 + lib/src/builtins/styled_element_builtin.dart | 14 +++++++++++--- lib/src/css_parser.dart | 2 +- lib/src/style.dart | 4 ++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/src/builtins/interactive_element_builtin.dart b/lib/src/builtins/interactive_element_builtin.dart index d430b3a847..f0f052676c 100644 --- a/lib/src/builtins/interactive_element_builtin.dart +++ b/lib/src/builtins/interactive_element_builtin.dart @@ -30,6 +30,7 @@ class InteractiveElementBuiltIn extends HtmlExtension { style: Style( color: Colors.blue, textDecoration: TextDecoration.underline, + textDecorationColor: Colors.blue, ), node: context.node, elementId: context.id, diff --git a/lib/src/builtins/styled_element_builtin.dart b/lib/src/builtins/styled_element_builtin.dart index a750c93187..a56a8f278d 100644 --- a/lib/src/builtins/styled_element_builtin.dart +++ b/lib/src/builtins/styled_element_builtin.dart @@ -414,9 +414,17 @@ class StyledElementBuiltIn extends HtmlExtension { continue monospace; underline: case "u": - styledElement.style = Style( - textDecoration: TextDecoration.underline, - ); + for (var child in styledElement.children) { + if (child.attributes.containsKey("style")) { + final newStyle = inlineCssToStyle(child.attributes["style"], null); + if (newStyle != null) { + styledElement.style = styledElement.style + .merge(Style(textDecorationColor: newStyle.color)); + } + } + } + styledElement.style = styledElement.style + .merge(Style(textDecoration: TextDecoration.underline)); break; case "var": continue italics; diff --git a/lib/src/css_parser.dart b/lib/src/css_parser.dart index 57169787bc..02cbe8a3ae 100644 --- a/lib/src/css_parser.dart +++ b/lib/src/css_parser.dart @@ -292,7 +292,7 @@ Style declarationsToStyle(Map> declarations) { style.border = newBorder; break; case 'color': - style.color = + style.color = style.textDecorationColor = ExpressionMapping.expressionToColor(value.first) ?? style.color; break; case 'direction': diff --git a/lib/src/style.dart b/lib/src/style.dart index d19fede664..014f7ff91f 100644 --- a/lib/src/style.dart +++ b/lib/src/style.dart @@ -404,6 +404,10 @@ class Style { child.textDecoration ?? TextDecoration.none, textDecoration ?? TextDecoration.none, ]), + textDecorationColor: child.textDecorationColor ?? textDecorationColor, + textDecorationThickness: + child.textDecorationThickness ?? textDecorationThickness, + textDecorationStyle: child.textDecorationStyle ?? textDecorationStyle, textShadow: child.textShadow ?? textShadow, whiteSpace: child.whiteSpace ?? whiteSpace, wordSpacing: child.wordSpacing ?? wordSpacing,