Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## Unreleased

### Fixed

- Fixed Markdown table links not working when Markdown is appended to https://github.com/Textualize/textual/pull/6638

## [8.2.8] - 2026-06-30

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ async def _update_rows(self, updated_rows: list[list[Content]]) -> None:
for row_index, row in enumerate(updated_rows, self.last_row):
for cell in row:
new_cells.append(
Static(
MarkdownTableCellContents(
cell,
classes=f"row{row_index} cell",
).with_tooltip(cell)
Expand Down
36 changes: 36 additions & 0 deletions tests/test_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,39 @@ def on_markdown_link_clicked(self, message: Markdown.LinkClicked):
async with app.run_test() as pilot:
await pilot.click(Markdown, offset=(3, 0))
assert links == ["tété"]


async def test_markdown_stream_table_links():
"""Regression test for https://github.com/Textualize/textual/issues/6597

Links in tables failed when the markdown was appended to.
"""

MD_TABLE = """
| Links |
| --- |
| first row |\n"""
MD_TABLE_ROW = """| [Example](https://www.example.com) |\n\n"""
links: list[str] = []

class CollectLinksMarkdown(Markdown):
def on_markdown_link_clicked(self, event: Markdown.LinkClicked):
event.stop()
event.prevent_default()
links.append(event.href)

class MDApp(App):
def compose(self) -> ComposeResult:
yield CollectLinksMarkdown()

async def on_mount(self) -> None:
await self.query_one(CollectLinksMarkdown).append(MD_TABLE)
await self.query_one(CollectLinksMarkdown).append(MD_TABLE_ROW)

app = MDApp()
async with app.run_test() as pilot:
await pilot.click(CollectLinksMarkdown, offset=(5, 5))
await pilot.pause()
app.save_screenshot(filename="markdowntable.svg")

assert links == ["https://www.example.com"]
Loading