File tree 2 files changed +31
-0
lines changed
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 {
399
399
verticalAlign: VerticalAlign .sub,
400
400
);
401
401
break ;
402
+ case "summary" :
403
+ styledElement.style = Style (
404
+ display: Display .block,
405
+ );
406
+ break ;
402
407
case "sup" :
403
408
styledElement.style = Style (
404
409
fontSize: FontSize .smaller,
Original file line number Diff line number Diff line change @@ -66,6 +66,32 @@ void main() {
66
66
},
67
67
);
68
68
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
+
69
95
// See https://github.com/Sub6Resources/flutter_html/issues/1251
70
96
testWidgets (
71
97
'test that preserved whitespace is actually preserved' ,
You can’t perform that action at this time.
0 commit comments