File tree 2 files changed +6
-10
lines changed 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -41,17 +41,13 @@ String stripComments(String str) {
41
41
return buf.toString ().trim ();
42
42
}
43
43
44
- /// This is special because it knows not to leave HTML tags open.
45
- /// Do not call this on unsanitized HTML.
46
44
String truncateString (String str, int length) {
47
- assert (str == null || ! str.contains ("<" ));
48
- if (str != null ) {
49
- if (str.length > length) {
50
- return '${str .substring (0 , length )}…' ;
51
- }
52
- return str;
45
+ if (str != null && str.length > length) {
46
+ // Do not call this on unsanitized HTML.
47
+ assert (! str.contains ("<" ));
48
+ return '${str .substring (0 , length )}…' ;
53
49
}
54
- return null ;
50
+ return str ;
55
51
}
56
52
57
53
String pluralize (String word, int count) => count == 1 ? word : '${word }s' ;
Original file line number Diff line number Diff line change @@ -350,4 +350,4 @@ packages:
350
350
source: hosted
351
351
version: "2.1.13"
352
352
sdks:
353
- dart: ">=1.23.0 <=2.0.0-dev.7 .0"
353
+ dart: ">=1.23.0 <=2.0.0-dev.8 .0"
You can’t perform that action at this time.
0 commit comments