File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,11 @@ class StyledElementBuiltIn extends HtmlExtension {
399399 verticalAlign: VerticalAlign .sub,
400400 );
401401 break ;
402+ case "summary" :
403+ styledElement.style = Style (
404+ display: Display .block,
405+ );
406+ break ;
402407 case "sup" :
403408 styledElement.style = Style (
404409 fontSize: FontSize .smaller,
Original file line number Diff line number Diff line change @@ -66,6 +66,32 @@ void main() {
6666 },
6767 );
6868
69+ //See https://github.com/Sub6Resources/flutter_html/issues/1275
70+ testWidgets (
71+ "test that extra newlines aren't added unnecessarily for details/summary tags" ,
72+ (tester) async {
73+ final tree = await generateStyledElementTreeFromHtml (
74+ tester,
75+ html: """
76+ <!DOCTYPE html>
77+ <html>
78+ <body>
79+ <details>
80+ <summary><h1>Header</h1></summary>
81+ <p>These are the details.</p>
82+ </details>
83+ </body>
84+ </html>
85+ """ ,
86+ );
87+
88+ expect (
89+ tree.getWhitespace (),
90+ equals (
91+ "<body><details><summary><h1>Header</h1></summary><p>These◦are◦the◦details.</p></details></body>" ));
92+ },
93+ );
94+
6995 // See https://github.com/Sub6Resources/flutter_html/issues/1251
7096 testWidgets (
7197 'test that preserved whitespace is actually preserved' ,
You can’t perform that action at this time.
0 commit comments