diff --git a/lib/layer-utils.ts b/lib/layer-utils.ts index 9a0867b5..12947dee 100644 --- a/lib/layer-utils.ts +++ b/lib/layer-utils.ts @@ -599,14 +599,19 @@ export function extractBlockText(block: any): string { /** * Recursively extract all unique inline mark types from a TipTap content block. + * Normalizes TipTap mark names to style keys (e.g., richTextLink → link). */ function extractInlineMarks(block: any): string[] { + const MARK_NAME_MAP: Record = { + richTextLink: 'link', + }; + const marks = new Set(); function traverse(node: any) { if (node.marks && Array.isArray(node.marks)) { node.marks.forEach((mark: any) => { - if (mark.type) marks.add(mark.type); + if (mark.type) marks.add(MARK_NAME_MAP[mark.type] || mark.type); }); } if (node.content && Array.isArray(node.content)) {