File tree 2 files changed +2
-23
lines changed 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 {
69
69
// scaling is used, but relies on https://github.com/flutter/flutter/pull/59711
70
70
// to wrap everything when larger accessibility fonts are used.
71
71
return StyledText (
72
- textSpan: parsedTree,
72
+ textSpan: parsedTree,
73
73
style: cleanedTree.style,
74
74
textScaleFactor: MediaQuery .of (context).textScaleFactor,
75
75
);
@@ -439,15 +439,13 @@ class HtmlParser extends StatelessWidget {
439
439
/// (2) Replace all newlines with a space
440
440
/// (3) Replace all tabs with a space
441
441
/// (4) Replace any instances of two or more spaces with a single space.
442
- /// (5) Remove remaining leading and trailing spaces.
443
442
static String _removeUnnecessaryWhitespace (String text) {
444
443
return text
445
444
.replaceAll (RegExp ("\ *(?=\n )" ), "\n " )
446
445
.replaceAll (RegExp ("(?:\n )\ *" ), "\n " )
447
446
.replaceAll ("\n " , " " )
448
447
.replaceAll ("\t " , " " )
449
- .replaceAll (RegExp (" {2,}" ), " " )
450
- .trim ();
448
+ .replaceAll (RegExp (" {2,}" ), " " );
451
449
}
452
450
453
451
/// [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() {
19
19
);
20
20
});
21
21
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
-
41
22
testNewParser ();
42
23
}
43
24
You can’t perform that action at this time.
0 commit comments