Better handle multiline formatting

This commit is contained in:
Scott Nonnenberg 2023-05-12 13:48:14 -07:00 committed by GitHub
parent bd0e08d6fd
commit 1c4213465b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 30 deletions

View file

@ -165,6 +165,11 @@ 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') {
return acc + op.insert;
}
// Start or finish format sections as needed
formats = extractAllFormats(startingBodyRanges, formats, acc.length, op);