Skip to content

fix(parser): resolve relative links in summary HTML - #44

Merged
timmaurice merged 1 commit into
masterfrom
c133/relative-summary-links
Nov 14, 2026
Merged

timmaurice merged 1 commit into
masterfrom
c133/relative-summary-links

Conversation

@timmaurice

Copy link
Copy Markdown
Owner

Summary

Relative href and src values inside the summary, content and subtitle HTML stayed relative, so in a dashboard they pointed at Home Assistant. They are now resolved against the feed URL, like link and links[].href already were (c013). Resolution runs after the HTML allow-list, so javascript: and similar URLs are still removed and only allowed URLs are joined. Entries and channel are both covered.

Tests

  • New regression test in tests/test_parser.py (absolute-path, relative-path, absolute URL, img src, javascript: href).
  • Full suite without tests/test_api.py: 338 passed. black clean; ruff clean on the changed source files.
  • tests/test_api.py fails locally with "the test opens sockets" (mismatched local venv), so CI is the reference for it.

Board card c133.

link and links[].href were joined with the feed URL, but href and src
inside the summary/content/subtitle HTML stayed relative. In a dashboard
they pointed at Home Assistant instead of the feed's host.

The sanitiser now resolves them against the feed URL after the
allow-list ran, so only URLs it let through are joined.
@timmaurice
timmaurice merged commit 5a07451 into master Nov 14, 2026
8 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.

1 participant