From adc0fb9d0d883d64522519ab1c94c1c0787a2296 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 12 Jun 2023 12:22:56 -0700 Subject: [PATCH] isNewlineOnlyOp: Fix regular expression to handle inconsistent deltas --- ts/quill/formatting/menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/quill/formatting/menu.tsx b/ts/quill/formatting/menu.tsx index 895c262aa20..c6b8adfa2e4 100644 --- a/ts/quill/formatting/menu.tsx +++ b/ts/quill/formatting/menu.tsx @@ -61,7 +61,7 @@ function isAllNewlines(ops: Array): boolean { } export function isNewlineOnlyOp(op: Op): boolean { - return isString(op.insert) && /^\n+$/gm.test(op.insert); + return isString(op.insert) && /^\n+$/g.test(op.insert); } export class FormattingMenu {