From 14f83abe78d0994b2d17d3634ca62a2937a2e020 Mon Sep 17 00:00:00 2001 From: claude_code Date: Tue, 30 Jun 2026 02:51:20 +0300 Subject: [PATCH] fix(editor-ext): remove duplicate escapeHtmlAttr (TS2393, broken CI) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merging the image-captions (#221) and lossless-export branches each added its own escapeHtmlAttr in turndown.utils.ts, producing two implementations of the same function and breaking `tsc --build` (TS2393) — which failed the Build editor-ext step across all CI jobs. Drop the lighter image-captions duplicate (escapes & and ") and keep the fuller version (escapes & " < >). It is a strict superset: both call sites (serializeAttrs, the image rule) place the value inside a double-quoted HTML attribute, where extra < > escaping is harmless and idempotent on re-import. Verified: editor-ext builds; turndown.dataloss + image-markdown tests pass. --- .../editor-ext/src/lib/markdown/utils/turndown.utils.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/editor-ext/src/lib/markdown/utils/turndown.utils.ts b/packages/editor-ext/src/lib/markdown/utils/turndown.utils.ts index 1a7a677d..a0345a1c 100644 --- a/packages/editor-ext/src/lib/markdown/utils/turndown.utils.ts +++ b/packages/editor-ext/src/lib/markdown/utils/turndown.utils.ts @@ -12,14 +12,6 @@ function sanitizeMdLinkText(value: string): string { .replace(/[\r\n]+/g, ' '); } -// Escape a value placed inside a double-quoted HTML attribute (img src/alt/ -// data-caption in the raw-HTML image fallback). Only & and " are special in -// that context; escaping them is idempotent because parse5/marked decode them -// back on re-import. -function escapeHtmlAttr(value: string): string { - return value.replace(/&/g, '&').replace(/"/g, '"'); -} - // Tags turndown treats as void (self-closing). Footnote references render as an // empty whose meaning lives entirely in its data-id; // without marking it void, turndown's blank-node removal drops it before our