fix: preserve_line_style assume the type of the operation data

pull/2023/head
CatHood0 9 months ago
parent 7c72967861
commit 9a7c5ab107
  1. 2
      lib/src/models/rules/insert.dart

@ -568,6 +568,7 @@ class PreserveInlineStylesRule extends InsertRule {
if (prevData.endsWith('\n')) {
/// If current line is empty get attributes from a prior line
final currLine = itr.next();
if (currLine.data is String) {
final currData = currLine.data as String?;
if (currData != null && (currData.isEmpty || currData[0] == '\n')) {
if (prevData.trimRight().isEmpty) {
@ -582,6 +583,7 @@ class PreserveInlineStylesRule extends InsertRule {
}
}
}
}
final attributes = <String, dynamic>{};
if (prev.attributes != null) {

Loading…
Cancel
Save