From 52498a6be374e5450d24115c388043327867b77f Mon Sep 17 00:00:00 2001 From: Filip Krawczyk Date: Fri, 5 Aug 2022 10:17:21 +0200 Subject: [PATCH] minor string tweaks --- lib/formatter.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/formatter.dart b/lib/formatter.dart index 5638d86..a1ddf55 100644 --- a/lib/formatter.dart +++ b/lib/formatter.dart @@ -55,7 +55,7 @@ class MarkdownFormatter extends TextInputFormatter { newValue.text.lineBefore(newValue.selection.baseOffset - 2); TextEditingValue listContinuation(String listChar, TextEditingValue tev) { - final regex = RegExp('(\\s*)${RegExp.escape(listChar)} '); + final regex = RegExp(r'(\s*)' '${RegExp.escape(listChar)} '); final match = regex.matchAsPrefix(lineBefore); if (match == null) { return tev; @@ -67,7 +67,8 @@ class MarkdownFormatter extends TextInputFormatter { TextEditingValue numberedListContinuation( String afterNumberChar, TextEditingValue tev) { - final regex = RegExp('(\\s*)(\\d+)${RegExp.escape(afterNumberChar)} '); + final regex = + RegExp(r'(\s*)(\d+)' '${RegExp.escape(afterNumberChar)} '); final match = regex.matchAsPrefix(lineBefore); if (match == null) { return tev;