Skip to content

Fix crash on anchor tags without href - #577

Open
zxyasfas wants to merge 1 commit into
ihabunek:masterfrom
zxyasfas:fix-anchor-missing-href
Open

zxyasfas wants to merge 1 commit into
ihabunek:masterfrom
zxyasfas:fix-anchor-missing-href

Conversation

@zxyasfas

Copy link
Copy Markdown

Fixes #549.

Instances that sanitize non-http schemes produce anchor tags with the href attribute stripped (GoToSocial does this to gemini:// links), which crashed render_anchor with a KeyError. Switched to .get(); the existing if href: branch already handles the missing case, so the anchor text still renders, just without the embedded link.

Added a regression test with an href-less anchor to tests/tui/test_rich_text.py.

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.

seemingly crashes with toots containing gemini protocol URLs

1 participant