File tree Expand file tree Collapse file tree 2 files changed +2
-23
lines changed
Expand file tree Collapse file tree 2 files changed +2
-23
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class HtmlParser extends StatelessWidget {
6969 // scaling is used, but relies on https://github.com/flutter/flutter/pull/59711
7070 // to wrap everything when larger accessibility fonts are used.
7171 return StyledText (
72- textSpan: parsedTree,
72+ textSpan: parsedTree,
7373 style: cleanedTree.style,
7474 textScaleFactor: MediaQuery .of (context).textScaleFactor,
7575 );
@@ -439,15 +439,13 @@ class HtmlParser extends StatelessWidget {
439439 /// (2) Replace all newlines with a space
440440 /// (3) Replace all tabs with a space
441441 /// (4) Replace any instances of two or more spaces with a single space.
442- /// (5) Remove remaining leading and trailing spaces.
443442 static String _removeUnnecessaryWhitespace (String text) {
444443 return text
445444 .replaceAll (RegExp ("\ *(?=\n )" ), "\n " )
446445 .replaceAll (RegExp ("(?:\n )\ *" ), "\n " )
447446 .replaceAll ("\n " , " " )
448447 .replaceAll ("\t " , " " )
449- .replaceAll (RegExp (" {2,}" ), " " )
450- .trim ();
448+ .replaceAll (RegExp (" {2,}" ), " " );
451449 }
452450
453451 /// [processListCharacters] adds list characters to the front of all list items.
Original file line number Diff line number Diff line change @@ -19,25 +19,6 @@ void main() {
1919 );
2020 });
2121
22- testWidgets ("Parser trims whitepaces" , (WidgetTester tester) async {
23- await tester.pumpWidget (
24- MaterialApp (
25- home: Scaffold (
26- body: Html (
27- data: """
28- <div>
29- content
30- </div>
31- """ ,
32- ),
33- ),
34- ),
35- );
36- expect (find.byType (Html ), findsOneWidget);
37- expect (find.text ("content" ), findsOneWidget);
38- expect (find.text (" content " ), findsNothing);
39- });
40-
4122 testNewParser ();
4223}
4324
You can’t perform that action at this time.
0 commit comments