Skip to content

fix(markdown): preserve link styling inside table cells#38

Merged
bahdotsh merged 2 commits into
mainfrom
fix/table-links
Mar 29, 2026
Merged

fix(markdown): preserve link styling inside table cells#38
bahdotsh merged 2 commits into
mainfrom
fix/table-links

Conversation

@bahdotsh
Copy link
Copy Markdown
Owner

@bahdotsh bahdotsh commented Mar 29, 2026

Summary

  • Fix links inside markdown tables being rendered as plain text instead of interactive links (fixes Links are not working inside markdown tables #26)
  • The Event::Text handler checked in_table before in_link, so link URL/styling was silently discarded for table cell content
  • Added in_link check inside the table branch to apply link color, underline, and link_url metadata

Test plan

  • cargo run -- test.md — verify the "Links in Tables" section shows colored, underlined links
  • Press f (LinkPicker) — verify table links (crates.io, docs.rs, #math-rendering anchor) appear in the list
  • Click a table link — verify it opens correctly
  • cargo clippy and cargo test pass cleanly

It turns out the Event::Text handler checks `in_table` *before*
`in_link`, so when text lives inside both a table cell and a link,
the table branch wins and the link URL is quietly discarded. The
link gets no color, no underline, and never shows up in the link
picker.

Check `in_link` inside the table branch and apply link styling when
both flags are true. Four lines, fixes #26.
Add a "Links in Tables" table with internal anchor and external
links (crates.io, docs.rs) so the fix from #26 is easy to verify
visually — these links are distinct from the ones already in the
file.
@bahdotsh bahdotsh merged commit 29baadd into main Mar 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Links are not working inside markdown tables

1 participant