Formatting: Expand exceptions to multi-newline ops, multiple ops
This commit is contained in:
parent
3ac2fb4ce4
commit
6e1916030d
3 changed files with 54 additions and 8 deletions
|
@ -13,7 +13,7 @@ import type {
|
|||
} from '../types/BodyRange';
|
||||
import { BodyRange } from '../types/BodyRange';
|
||||
import type { MentionBlot } from './mentions/blot';
|
||||
import { QuillFormattingStyle } from './formatting/menu';
|
||||
import { isNewlineOnlyOp, QuillFormattingStyle } from './formatting/menu';
|
||||
import { isNotNil } from '../util/isNotNil';
|
||||
|
||||
export type MentionBlotValue = {
|
||||
|
@ -165,8 +165,8 @@ export const getTextAndRangesFromOps = (
|
|||
};
|
||||
|
||||
const preTrimText = ops.reduce((acc, op) => {
|
||||
// We special-case single-newline ops because Quill doesn't apply styles to them
|
||||
if (op.insert === '\n') {
|
||||
// We special-case all-newline ops because Quill doesn't apply styles to them
|
||||
if (isNewlineOnlyOp(op)) {
|
||||
return acc + op.insert;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue