From 09a318a5e9c6705820ddb26bce96f1c28bbba805 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Thu, 7 May 2026 08:13:07 +0200 Subject: [PATCH] Revert "Fix ref links in tables regression" This reverts commit 15ccabc361419c912fbe9f2febfbfddf30f872b6. --- client/space_lua/render_lua_markdown.test.ts | 17 ----------------- client/space_lua/render_lua_markdown.ts | 10 ++-------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/client/space_lua/render_lua_markdown.test.ts b/client/space_lua/render_lua_markdown.test.ts index 423041ca..35bb5ed4 100644 --- a/client/space_lua/render_lua_markdown.test.ts +++ b/client/space_lua/render_lua_markdown.test.ts @@ -409,23 +409,6 @@ test("e2e: table with wiki links produces clickable links", async () => { ); }); -test("e2e: ref column is rendered as a wiki link", async () => { - const row = new LuaTable(); - await row.rawSet("name", "Alice"); - await row.rawSet("ref", "SomePage"); - - const tbl = new LuaTable(); - await tbl.rawSet(1, row); - - expect(toHtml(tbl)).toBe( - "" + - '' + - '
nameref
Alice' + - 'SomePage' + - "
", - ); -}); - test("e2e: table with bold text renders strong tags", async () => { const row = new LuaTable(); await row.rawSet("note", "**important**"); diff --git a/client/space_lua/render_lua_markdown.ts b/client/space_lua/render_lua_markdown.ts index 4a5b5e14..c1c5c232 100644 --- a/client/space_lua/render_lua_markdown.ts +++ b/client/space_lua/render_lua_markdown.ts @@ -56,7 +56,7 @@ function buildHtmlTable( parts.push(""); for (let i = 0; i < rowCount; i++) { parts.push(""); - for (const h of headers) parts.push(renderTd(getCell(i, h), h)); + for (const h of headers) parts.push(renderTd(getCell(i, h))); parts.push(""); } parts.push(""); @@ -330,16 +330,10 @@ function luaTypeName(v: any): string | undefined { return "string"; } -function renderTd(v: any, header?: string): string { +function renderTd(v: any): string { if (isEmpty(v)) return ""; const type = luaTypeName(v); const attr = type ? ` data-table-cell-type="${type}"` : ""; - // `ref` columns hold a page name by convention — wrap scalars in - // wiki-link syntax so the markdown renderer turns them into clickable - // page links (mirrors the clean-markdown copy path). - if (header === "ref" && (type === "string" || type === "number")) { - return `[[${formatScalar(v)}]]`; - } return `${renderCellContent(v)}`; }