isNewlineOnlyOp: Fix regular expression to handle inconsistent deltas

This commit is contained in:
Scott Nonnenberg 2023-06-12 12:22:56 -07:00 committed by GitHub
parent ff9e95053d
commit adc0fb9d0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,7 @@ function isAllNewlines(ops: Array<Op>): 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 {