Skip to content

Commit e3b95f7

Browse files
committed
A few more minor fixes
1 parent 28da60f commit e3b95f7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/src/css_parser.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:ui';
22

33
import 'package:csslib/visitor.dart' as css;
44
import 'package:csslib/parser.dart' as cssparser;
5+
import 'package:flutter/cupertino.dart';
56
import 'package:flutter_html/style.dart';
67

78
Style declarationsToStyle(Map<String, List<css.Expression>> declarations) {
@@ -44,7 +45,7 @@ Style declarationsToStyle(Map<String, List<css.Expression>> declarations) {
4445
case 'text-decoration':
4546
List<css.LiteralTerm> textDecorationList = value.whereType<css.LiteralTerm>().toList();
4647
/// List<css.LiteralTerm> might include other values than the ones we want for [textDecorationList], so make sure to remove those before passing it to [ExpressionMapping]
47-
textDecorationList.removeWhere((element) => element.text != "overline" && element.text != "underline" && element.text != "line-through");
48+
textDecorationList.removeWhere((element) => element.text != "none" && element.text != "overline" && element.text != "underline" && element.text != "line-through");
4849
css.Expression textDecorationColor = value.firstWhere((element) => element is css.HexColorTerm || element is css.FunctionTerm, orElse: null);
4950
List<css.LiteralTerm> temp = value.whereType<css.LiteralTerm>().toList();
5051
/// List<css.LiteralTerm> might include other values than the ones we want for [textDecorationStyle], so make sure to remove those before passing it to [ExpressionMapping]
@@ -166,8 +167,8 @@ class ExpressionMapping {
166167
}
167168
}
168169
}
169-
fontFeatures.toSet().toList();
170-
return fontFeatures;
170+
List<FontFeature> finalFontFeatures = fontFeatures.toSet().toList();
171+
return finalFontFeatures;
171172
}
172173

173174
static FontSize expressionToFontSize(css.Expression value) {
@@ -308,6 +309,7 @@ class ExpressionMapping {
308309
break;
309310
}
310311
}
312+
if (decorationList.contains(TextDecoration.none)) decorationList = [TextDecoration.none];
311313
return TextDecoration.combine(decorationList);
312314
}
313315

@@ -373,8 +375,8 @@ class ExpressionMapping {
373375
}
374376
}
375377
}
376-
shadow.toSet().toList();
377-
return shadow;
378+
List<Shadow> finalShadows = shadow.toSet().toList();
379+
return finalShadows;
378380
}
379381

380382
static Color stringToColor(String _text) {

0 commit comments

Comments
 (0)