From 2552c3e463467ead418461324fe0a4a83b730c0c Mon Sep 17 00:00:00 2001 From: "SOUTHAMERICA\\bvalverde" Date: Tue, 4 Jun 2024 12:01:38 -0600 Subject: [PATCH 1/6] mergeLinkFormat --- .../lib/modelApi/editing/mergeModel.ts | 58 ++++- .../test/modelApi/editing/mergeModelTest.ts | 210 ++++++++++++++++++ 2 files changed, 266 insertions(+), 2 deletions(-) diff --git a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts index b440afd1f69..b8d123f7dc1 100644 --- a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts +++ b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts @@ -14,6 +14,7 @@ import type { ContentModelBlock, ContentModelBlockFormat, ContentModelDocument, + ContentModelHyperLinkFormat, ContentModelListItem, ContentModelParagraph, ContentModelSegmentFormat, @@ -347,7 +348,7 @@ function applyDefaultFormat( break; case 'Paragraph': - const paragraphFormat = block.decorator?.format || {}; + const paraFormat = block.decorator?.format || {}; const paragraph = mutateBlock(block); paragraph.segments.forEach(segment => { @@ -356,9 +357,18 @@ function applyDefaultFormat( } segment.format = mergeSegmentFormat(applyDefaultFormatOption, format, { - ...paragraphFormat, + ...paraFormat, ...segment.format, }); + + if (segment.link) { + segment.link.format = mergeLinkFormat( + applyDefaultFormatOption, + format, + paraFormat, + segment.link.format + ); + } }); if (applyDefaultFormatOption === 'keepSourceEmphasisFormat') { @@ -375,6 +385,50 @@ function mergeBlockFormat(applyDefaultFormatOption: string, block: ReadonlyConte } } +function mergeLinkFormat( + applyDefaultFormatOption: 'mergeAll' | 'keepSourceEmphasisFormat', + targetFormat: ContentModelSegmentFormat, + paraFormat: ContentModelSegmentFormat, + linkFormat: ContentModelHyperLinkFormat +) { + const segmentFormat = mergeSegmentFormat( + applyDefaultFormatOption, + getSegmentFormatInLinkFormat(targetFormat), + { + ...getSegmentFormatInLinkFormat(paraFormat), + ...getSegmentFormatInLinkFormat(linkFormat), + } + ); + + if (applyDefaultFormatOption == 'keepSourceEmphasisFormat') { + delete linkFormat.backgroundColor; + delete linkFormat.textColor; + } + + return { + ...linkFormat, + ...segmentFormat, + }; +} + +function getSegmentFormatInLinkFormat( + targetFormat: ContentModelSegmentFormat +): ContentModelSegmentFormat { + const result = { + textColor: targetFormat.textColor, + backgroundColor: targetFormat.backgroundColor, + underline: targetFormat.underline, + }; + + getObjectKeys(result).forEach(key => { + if (result[key] == undefined) { + delete result[key]; + } + }); + + return result; +} + function mergeSegmentFormat( applyDefaultFormatOption: 'mergeAll' | 'keepSourceEmphasisFormat', targetFormat: ContentModelSegmentFormat, diff --git a/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts b/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts index 538aaee4bd7..6548c73a420 100644 --- a/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts +++ b/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts @@ -3533,4 +3533,214 @@ describe('mergeModel', () => { tableContext: undefined, }); }); + + it('Merge Link Format with mergeAll option', () => { + const newTarget: ContentModelDocument = { + blockGroupType: 'Document', + blocks: [ + { + segments: [ + { + isSelected: true, + segmentType: 'SelectionMarker', + format: { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }, + }, + ], + segmentFormat: { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }, + blockType: 'Paragraph', + format: {}, + }, + ], + format: { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }, + }; + const mergeLinkSourceModel: ContentModelDocument = { + blockGroupType: 'Document', + blocks: [ + { + blockType: 'Paragraph', + segments: [ + { + segmentType: 'Text', + text: 'Work Item 222824', + format: { + fontFamily: + '"Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontSize: '14px', + textColor: 'var(--communication-foreground,rgba(0, 90, 158, 1))', + underline: true, + italic: false, + backgroundColor: 'rgb(32, 31, 30)', + }, + link: { + format: { + underline: true, + href: 'https://www.bing.com', + anchorClass: 'bolt-link', + textColor: + 'var(--communication-foreground,rgba(0, 90, 158, 1))', + backgroundColor: 'rgb(32, 31, 30)', + borderRadius: '2px', + textAlign: 'start', + }, + dataset: {}, + }, + }, + { + segmentType: 'Text', + text: 'Test', + format: { + fontFamily: + '"Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontSize: '14px', + textColor: 'rgb(255, 255, 255)', + italic: false, + backgroundColor: 'rgb(32, 31, 30)', + }, + }, + ], + format: {}, + isImplicit: true, + segmentFormat: { + fontFamily: + '"Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontSize: '14px', + }, + }, + ], + }; + mergeModel(newTarget, mergeLinkSourceModel, undefined, { + mergeFormat: 'mergeAll', + }); + + const para = newTarget.blocks[0] as ContentModelParagraph; + expect(para.segments[0].link).toEqual({ + format: { + href: 'https://www.bing.com', + anchorClass: 'bolt-link', + borderRadius: '2px', + textAlign: 'start', + textColor: 'var(--communication-foreground,rgba(0, 90, 158, 1))', + backgroundColor: 'rgb(32, 31, 30)', + underline: true, + }, + dataset: {}, + }); + }); + + it('Merge Link Format with keepSourceEmphasisFormat option', () => { + const targetModel: ContentModelDocument = { + blockGroupType: 'Document', + blocks: [ + { + segments: [ + { + isSelected: true, + segmentType: 'SelectionMarker', + format: { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }, + }, + ], + segmentFormat: { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }, + blockType: 'Paragraph', + format: {}, + }, + ], + format: { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }, + }; + const sourceModel: ContentModelDocument = { + blockGroupType: 'Document', + blocks: [ + { + blockType: 'Paragraph', + segments: [ + { + segmentType: 'Text', + text: 'Work Item 222824', + format: { + fontFamily: + '"Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontSize: '14px', + textColor: 'var(--communication-foreground,rgba(0, 90, 158, 1))', + underline: true, + italic: false, + backgroundColor: 'rgb(32, 31, 30)', + }, + link: { + format: { + underline: true, + href: 'https://www.bing.com', + anchorClass: 'bolt-link', + textColor: + 'var(--communication-foreground,rgba(0, 90, 158, 1))', + backgroundColor: 'rgb(32, 31, 30)', + borderRadius: '2px', + textAlign: 'start', + }, + dataset: {}, + }, + }, + { + segmentType: 'Text', + text: 'Test', + format: { + fontFamily: + '"Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontSize: '14px', + textColor: 'rgb(255, 255, 255)', + italic: false, + backgroundColor: 'rgb(32, 31, 30)', + }, + }, + ], + format: {}, + isImplicit: true, + segmentFormat: { + fontFamily: + '"Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontSize: '14px', + }, + }, + ], + }; + + mergeModel(targetModel, sourceModel, undefined, { + mergeFormat: 'keepSourceEmphasisFormat', + }); + + const para = targetModel.blocks[0] as ContentModelParagraph; + expect(para.segments[0].link).toEqual({ + format: { + href: 'https://www.bing.com', + anchorClass: 'bolt-link', + borderRadius: '2px', + textAlign: 'start', + textColor: '#000000', + underline: true, + }, + dataset: {}, + }); + }); }); From 0fbb114b7d304d253b236757c0195a59944cd74d Mon Sep 17 00:00:00 2001 From: "SOUTHAMERICA\\bvalverde" Date: Wed, 5 Jun 2024 10:33:48 -0600 Subject: [PATCH 2/6] Also fix for images --- .../lib/modelApi/editing/mergeModel.ts | 99 ++++++++++--------- .../test/modelApi/editing/mergeModelTest.ts | 92 +++++++++++++++++ 2 files changed, 144 insertions(+), 47 deletions(-) diff --git a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts index b8d123f7dc1..bdd0ee93e88 100644 --- a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts +++ b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts @@ -348,7 +348,7 @@ function applyDefaultFormat( break; case 'Paragraph': - const paraFormat = block.decorator?.format || {}; + const decoratorFormat = block.decorator?.format || {}; const paragraph = mutateBlock(block); paragraph.segments.forEach(segment => { @@ -356,16 +356,17 @@ function applyDefaultFormat( applyDefaultFormat(segment, format, applyDefaultFormatOption); } - segment.format = mergeSegmentFormat(applyDefaultFormatOption, format, { - ...paraFormat, - ...segment.format, - }); + segment.format = mergeSegmentFormat( + applyDefaultFormatOption, + format, + segment.format, + decoratorFormat + ); if (segment.link) { - segment.link.format = mergeLinkFormat( + segment.link.format = mergeSegmentFormat( applyDefaultFormatOption, - format, - paraFormat, + getSegmentFormatInLinkFormat(format), segment.link.format ); } @@ -385,46 +386,23 @@ function mergeBlockFormat(applyDefaultFormatOption: string, block: ReadonlyConte } } -function mergeLinkFormat( - applyDefaultFormatOption: 'mergeAll' | 'keepSourceEmphasisFormat', - targetFormat: ContentModelSegmentFormat, - paraFormat: ContentModelSegmentFormat, - linkFormat: ContentModelHyperLinkFormat -) { - const segmentFormat = mergeSegmentFormat( - applyDefaultFormatOption, - getSegmentFormatInLinkFormat(targetFormat), - { - ...getSegmentFormatInLinkFormat(paraFormat), - ...getSegmentFormatInLinkFormat(linkFormat), - } - ); - - if (applyDefaultFormatOption == 'keepSourceEmphasisFormat') { - delete linkFormat.backgroundColor; - delete linkFormat.textColor; - } - - return { - ...linkFormat, - ...segmentFormat, - }; -} - +/** + * Hyperlink format type definition only contains textColor, backgroundColor and underline. + * So create a minimum object with the styles supported in Hyperlink to be used in merge. + */ function getSegmentFormatInLinkFormat( targetFormat: ContentModelSegmentFormat ): ContentModelSegmentFormat { - const result = { - textColor: targetFormat.textColor, - backgroundColor: targetFormat.backgroundColor, - underline: targetFormat.underline, - }; - - getObjectKeys(result).forEach(key => { - if (result[key] == undefined) { - delete result[key]; - } - }); + const result: ContentModelHyperLinkFormat = {}; + if (targetFormat.textColor) { + result.textColor = targetFormat.textColor; + } + if (targetFormat.backgroundColor) { + result.backgroundColor = targetFormat.backgroundColor; + } + if (targetFormat.underline) { + result.underline = targetFormat.underline; + } return result; } @@ -432,11 +410,13 @@ function getSegmentFormatInLinkFormat( function mergeSegmentFormat( applyDefaultFormatOption: 'mergeAll' | 'keepSourceEmphasisFormat', targetFormat: ContentModelSegmentFormat, - sourceFormat: ContentModelSegmentFormat + sourceFormat: ContentModelSegmentFormat, + decoratorFormat: ContentModelSegmentFormat = {} ): ContentModelSegmentFormat { return applyDefaultFormatOption == 'mergeAll' - ? { ...targetFormat, ...sourceFormat } + ? { ...targetFormat, ...decoratorFormat, ...sourceFormat } : { + ...getFormatWithoutSegmentFormat(sourceFormat), ...targetFormat, ...getSemanticFormat(sourceFormat), }; @@ -459,3 +439,28 @@ function getSemanticFormat(segmentFormat: ContentModelSegmentFormat): ContentMod return result; } + +/** + * Segment format can also contain other type of metadata, for example in Images/Hyperlink we want to preserve those properties + */ +function getFormatWithoutSegmentFormat( + sourceFormat: ContentModelSegmentFormat +): ContentModelSegmentFormat { + const resultFormat = { + ...sourceFormat, + }; + + delete resultFormat.backgroundColor; + delete resultFormat.fontFamily; + delete resultFormat.fontSize; + delete resultFormat.fontWeight; + delete resultFormat.italic; + delete resultFormat.letterSpacing; + delete resultFormat.lineHeight; + delete resultFormat.strikethrough; + delete resultFormat.superOrSubScriptSequence; + delete resultFormat.textColor; + delete resultFormat.underline; + + return resultFormat; +} diff --git a/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts b/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts index 6548c73a420..b22a2988f7b 100644 --- a/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts +++ b/packages/roosterjs-content-model-dom/test/modelApi/editing/mergeModelTest.ts @@ -3743,4 +3743,96 @@ describe('mergeModel', () => { dataset: {}, }); }); + + it('Keep image width when merging with keepSourceEmphasisFormat', () => { + const targetModel = createContentModelDocument(); + const para = createParagraph(); + const marker = createSelectionMarker(); + para.segments.push(marker); + targetModel.blocks.push(para); + + marker.format = { + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + }; + + const sourceModel = createContentModelDocument(); + sourceModel.blocks.push({ + blockType: 'Paragraph', + format: {}, + segments: [ + { + segmentType: 'Image', + format: { + fontFamily: 'Remove this', + fontSize: 'Remove this', + textColor: 'Remove this', + backgroundColor: 'imageColor', + width: 'imageWidth', + maxWidth: 'imageMaxWidth', + height: 'imageHeight', + maxHeight: 'imageMaxHeight', + id: 'imageId', + marginBottom: '0px', + marginLeft: '0px', + marginRight: '0px', + marginTop: '0px', + borderBottom: 'border', + borderBottomLeftRadius: 'border', + borderBottomRightRadius: 'border', + borderLeft: 'border', + borderRadius: 'border', + borderTop: 'border', + borderRight: 'border', + borderTopLeftRadius: 'border', + borderTopRightRadius: 'border', + boxShadow: 'border', + display: 'display', + float: 'float', + minHeight: 'minHeight', + minWidth: 'minWidth', + verticalAlign: 'top', + }, + dataset: {}, + src: 'https://www.bing.com', + }, + ], + }); + + mergeModel(targetModel, sourceModel, undefined, { + mergeFormat: 'keepSourceEmphasisFormat', + }); + + const block = targetModel.blocks[0] as ContentModelParagraph; + expect(block.segments[0].format).toEqual({ + fontFamily: 'Calibri', + fontSize: '11pt', + textColor: '#000000', + width: 'imageWidth', + maxWidth: 'imageMaxWidth', + height: 'imageHeight', + maxHeight: 'imageMaxHeight', + id: 'imageId', + marginBottom: '0px', + marginLeft: '0px', + marginRight: '0px', + marginTop: '0px', + borderBottom: 'border', + borderBottomLeftRadius: 'border', + borderBottomRightRadius: 'border', + borderLeft: 'border', + borderRadius: 'border', + borderTop: 'border', + borderRight: 'border', + borderTopLeftRadius: 'border', + borderTopRightRadius: 'border', + boxShadow: 'border', + display: 'display', + float: 'float', + minHeight: 'minHeight', + minWidth: 'minWidth', + verticalAlign: 'top', + }); + }); }); From 5b1c7bd53e694725d14d5d968b3448ac45542dac Mon Sep 17 00:00:00 2001 From: "SOUTHAMERICA\\bvalverde" Date: Wed, 5 Jun 2024 10:45:15 -0600 Subject: [PATCH 3/6] remove unneeded changes --- .../lib/modelApi/editing/mergeModel.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts index bdd0ee93e88..a1bcd6ffd6f 100644 --- a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts +++ b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts @@ -356,12 +356,10 @@ function applyDefaultFormat( applyDefaultFormat(segment, format, applyDefaultFormatOption); } - segment.format = mergeSegmentFormat( - applyDefaultFormatOption, - format, - segment.format, - decoratorFormat - ); + segment.format = mergeSegmentFormat(applyDefaultFormatOption, format, { + ...decoratorFormat, + ...segment.format, + }); if (segment.link) { segment.link.format = mergeSegmentFormat( @@ -410,11 +408,10 @@ function getSegmentFormatInLinkFormat( function mergeSegmentFormat( applyDefaultFormatOption: 'mergeAll' | 'keepSourceEmphasisFormat', targetFormat: ContentModelSegmentFormat, - sourceFormat: ContentModelSegmentFormat, - decoratorFormat: ContentModelSegmentFormat = {} + sourceFormat: ContentModelSegmentFormat ): ContentModelSegmentFormat { return applyDefaultFormatOption == 'mergeAll' - ? { ...targetFormat, ...decoratorFormat, ...sourceFormat } + ? { ...targetFormat, ...sourceFormat } : { ...getFormatWithoutSegmentFormat(sourceFormat), ...targetFormat, @@ -441,7 +438,8 @@ function getSemanticFormat(segmentFormat: ContentModelSegmentFormat): ContentMod } /** - * Segment format can also contain other type of metadata, for example in Images/Hyperlink we want to preserve those properties + * Segment format can also contain other type of metadata, for example in Images/Hyperlink, + * we want to preserve these properties when merging format */ function getFormatWithoutSegmentFormat( sourceFormat: ContentModelSegmentFormat From 703d1032d72c8bedb7b94c3ef049dd3c83085c54 Mon Sep 17 00:00:00 2001 From: "SOUTHAMERICA\\bvalverde" Date: Wed, 5 Jun 2024 10:46:22 -0600 Subject: [PATCH 4/6] Remove more unneeded changes --- .../lib/modelApi/editing/mergeModel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts index a1bcd6ffd6f..9a41a44ef81 100644 --- a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts +++ b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts @@ -348,7 +348,7 @@ function applyDefaultFormat( break; case 'Paragraph': - const decoratorFormat = block.decorator?.format || {}; + const paragraphFormat = block.decorator?.format || {}; const paragraph = mutateBlock(block); paragraph.segments.forEach(segment => { @@ -357,7 +357,7 @@ function applyDefaultFormat( } segment.format = mergeSegmentFormat(applyDefaultFormatOption, format, { - ...decoratorFormat, + ...paragraphFormat, ...segment.format, }); From c3a30e586a5e06ae9807822869979441a26e5d3c Mon Sep 17 00:00:00 2001 From: "SOUTHAMERICA\\bvalverde" Date: Wed, 5 Jun 2024 12:11:23 -0600 Subject: [PATCH 5/6] Address comment --- .../lib/modelApi/editing/mergeModel.ts | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts index 9a41a44ef81..12549409137 100644 --- a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts +++ b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts @@ -29,6 +29,21 @@ import type { } from 'roosterjs-content-model-types'; const HeadingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; +// An object to provide keys of required properties of segment format, the do NOT use any of its values +const RequiredEmptySegmentFormat: Required = { + backgroundColor: null!, + fontFamily: null!, + fontSize: null!, + fontWeight: null!, + italic: null!, + letterSpacing: null!, + lineHeight: null!, + strikethrough: null!, + superOrSubScriptSequence: null!, + textColor: null!, + underline: null!, +}; +const KeysOfSegmentFormat = getObjectKeys(RequiredEmptySegmentFormat); /** * Merge source model into target mode @@ -447,18 +462,6 @@ function getFormatWithoutSegmentFormat( const resultFormat = { ...sourceFormat, }; - - delete resultFormat.backgroundColor; - delete resultFormat.fontFamily; - delete resultFormat.fontSize; - delete resultFormat.fontWeight; - delete resultFormat.italic; - delete resultFormat.letterSpacing; - delete resultFormat.lineHeight; - delete resultFormat.strikethrough; - delete resultFormat.superOrSubScriptSequence; - delete resultFormat.textColor; - delete resultFormat.underline; - + KeysOfSegmentFormat.forEach(key => delete resultFormat[key]); return resultFormat; } From 23b674a8f3f224cca43c747e7e824cbc5f679d45 Mon Sep 17 00:00:00 2001 From: "SOUTHAMERICA\\bvalverde" Date: Wed, 5 Jun 2024 12:16:59 -0600 Subject: [PATCH 6/6] nit --- .../lib/modelApi/editing/mergeModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts index 12549409137..94ed4f65319 100644 --- a/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts +++ b/packages/roosterjs-content-model-dom/lib/modelApi/editing/mergeModel.ts @@ -29,7 +29,7 @@ import type { } from 'roosterjs-content-model-types'; const HeadingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; -// An object to provide keys of required properties of segment format, the do NOT use any of its values +// An object to provide keys of required properties of segment format, do NOT use any of its values const RequiredEmptySegmentFormat: Required = { backgroundColor: null!, fontFamily: null!,