diff --git a/lib/src/models/documents/nodes/line.dart b/lib/src/models/documents/nodes/line.dart index b9e7191d..539f3c5d 100644 --- a/lib/src/models/documents/nodes/line.dart +++ b/lib/src/models/documents/nodes/line.dart @@ -352,18 +352,13 @@ class Line extends Container { final excluded = {}; void _handle(Style style) { - if (result.isEmpty) { - excluded.addAll(style.values); - } else { - for (final attr in result.values) { - if (!style.containsKey(attr.key)) { - excluded.add(attr); - } + for (final attr in result.values) { + if (!style.containsKey(attr.key) || + (style.attributes[attr.key] != attr.value)) { + excluded.add(attr); } } - final remaining = style.removeAll(excluded); result = result.removeAll(excluded); - result = result.mergeAll(remaining); } final data = queryChild(offset, true);