From baa4df04d4773bcc1dc5c897616197ffdcc1d4b5 Mon Sep 17 00:00:00 2001 From: CatHood0 Date: Tue, 16 Jul 2024 14:36:44 -0400 Subject: [PATCH] fix: removed regexp on startWith --- lib/src/models/rules/insert.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/models/rules/insert.dart b/lib/src/models/rules/insert.dart index 641c12af..d09bb452 100644 --- a/lib/src/models/rules/insert.dart +++ b/lib/src/models/rules/insert.dart @@ -570,8 +570,7 @@ class PreserveInlineStylesRule extends InsertRule { final currLine = itr.next(); final currData = currLine.data is String ? currLine.data as String : null; - if (currData != null && - (currData.isEmpty || currData.startsWith(RegExp('^\n')))) { + if (currData?.isEmpty == true || currData?.startsWith('\n') == true) { if (prevData.trimRight().isEmpty) { final back = DeltaIterator(documentDelta).skip(index - prevData.length);