From 089ffae3c8dd4d53042bab37523fc45daead97a4 Mon Sep 17 00:00:00 2001 From: jiuqingsong Date: Thu, 22 Oct 2026 11:40:49 -0700 Subject: [PATCH 1/3] Upgrade follow-redirects to 1.16.1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6935bbb2-30ad-4576-9e1b-078344b2df42 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 55093cbe34f..93f6c5174c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2969,9 +2969,9 @@ flatted@^3.2.7, flatted@^3.2.9: integrity sha1-ruyipQYwPwzuYcWebJ8qiNLyn8Y= follow-redirects@^1.0.0: - version "1.16.0" - resolved "https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/follow-redirects/-/follow-redirects-1.16.0.tgz#28474a159d3b9d11ef62050a14ed60e4df6d61bc" - integrity sha1-KEdKFZ07nRHvYgUKFO1g5N9tYbw= + version "1.16.1" + resolved "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/follow-redirects/-/follow-redirects-1.16.1.tgz#6e0efa40a727fb369b98dab15883ec34787d675e" + integrity sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg== for-each@^0.3.3, for-each@^0.3.5: version "0.3.5" From 7e86902a0116715e718e2b13de9e9524b885e86c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 20:59:24 +0000 Subject: [PATCH 2/3] [DOM] Normalize parsed font families Co-authored-by: JiuqingSong <23065085+JiuqingSong@users.noreply.github.com> --- .../lib/formatHandlers/segment/fontFamilyFormatHandler.ts | 3 ++- .../formatHandlers/segment/fontFamilyFormatHandlerTest.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts b/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts index 3c04a51dc2a..2f280042099 100644 --- a/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts +++ b/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts @@ -1,5 +1,6 @@ import type { FontFamilyFormat } from 'roosterjs-content-model-types'; import type { FormatHandler } from '../FormatHandler'; +import { normalizeFontFamily } from '../../domUtils/style/normalizeFontFamily'; /** * @internal @@ -9,7 +10,7 @@ export const fontFamilyFormatHandler: FormatHandler = { const fontFamily = element.style.fontFamily || defaultStyle.fontFamily; if (fontFamily && fontFamily != 'inherit') { - format.fontFamily = fontFamily; + format.fontFamily = normalizeFontFamily(fontFamily); } }, apply: (format, element, context) => { diff --git a/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts b/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts index 2e99c2b7e4a..9b4285eec0c 100644 --- a/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts +++ b/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts @@ -31,6 +31,13 @@ describe('fontFamilyFormatHandler.parse', () => { expect(format.fontFamily).toBe('test'); }); + it('Normalize font from element', () => { + div.style.fontFamily = 'Courier New'; + fontFamilyFormatHandler.parse(format, div, context, {}); + + expect(format.fontFamily).toBe('"Courier New"'); + }); + it('Font from default style', () => { fontFamilyFormatHandler.parse(format, div, context, { fontFamily: 'test' }); From eb9f210fcca9d64b6be11407cd038c28a67ad74d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 21:03:51 +0000 Subject: [PATCH 3/3] Revert font-family normalization Co-authored-by: JiuqingSong <23065085+JiuqingSong@users.noreply.github.com> --- .../lib/formatHandlers/segment/fontFamilyFormatHandler.ts | 3 +-- .../formatHandlers/segment/fontFamilyFormatHandlerTest.ts | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts b/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts index 2f280042099..3c04a51dc2a 100644 --- a/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts +++ b/packages/roosterjs-content-model-dom/lib/formatHandlers/segment/fontFamilyFormatHandler.ts @@ -1,6 +1,5 @@ import type { FontFamilyFormat } from 'roosterjs-content-model-types'; import type { FormatHandler } from '../FormatHandler'; -import { normalizeFontFamily } from '../../domUtils/style/normalizeFontFamily'; /** * @internal @@ -10,7 +9,7 @@ export const fontFamilyFormatHandler: FormatHandler = { const fontFamily = element.style.fontFamily || defaultStyle.fontFamily; if (fontFamily && fontFamily != 'inherit') { - format.fontFamily = normalizeFontFamily(fontFamily); + format.fontFamily = fontFamily; } }, apply: (format, element, context) => { diff --git a/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts b/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts index 9b4285eec0c..2e99c2b7e4a 100644 --- a/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts +++ b/packages/roosterjs-content-model-dom/test/formatHandlers/segment/fontFamilyFormatHandlerTest.ts @@ -31,13 +31,6 @@ describe('fontFamilyFormatHandler.parse', () => { expect(format.fontFamily).toBe('test'); }); - it('Normalize font from element', () => { - div.style.fontFamily = 'Courier New'; - fontFamilyFormatHandler.parse(format, div, context, {}); - - expect(format.fontFamily).toBe('"Courier New"'); - }); - it('Font from default style', () => { fontFamilyFormatHandler.parse(format, div, context, { fontFamily: 'test' });