From c235f5373dec7ba795c5bc7112c9e5f72cb94791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Lun=C4=97nas?= <34475426+lunenas@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:47:13 +0200 Subject: [PATCH] fix: show Link sublayer in rich text layers tree The TipTap mark name (richTextLink) was not mapped to the style key (link), so the Link sublayer never appeared in the layers tree and its classes could not be edited on the canvas. Made-with: Cursor --- lib/layer-utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/layer-utils.ts b/lib/layer-utils.ts index 2bb63945..e6f47da1 100644 --- a/lib/layer-utils.ts +++ b/lib/layer-utils.ts @@ -597,14 +597,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)) {