Skip to content

feat: add absolutizeContent to resolve relative URLs in item HTML - #162

Merged
otnc merged 2 commits into
mainfrom
feat/absolutize-content
Oct 14, 2026
Merged

otnc merged 2 commits into
mainfrom
feat/absolutize-content

Conversation

@otnc

@otnc otnc commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix bug(s)
  • New feature(s)
  • Others

Add an opt-in feed option, absolutizeContent. When set and a base URL is known (baseUrl, which serveFeed defaults to the request origin), relative src / href / poster / srcset values in each item's HTML content and description are rewritten to absolute URLs, in RSS, Atom and JSON Feed. The rewrite is a small quote-aware scanner over start tags only: text, comments, CDATA and <script> / <style> bodies are never touched, and absolute values, fragments, other schemes and values with unusual entities are left as written. README (en/ja) is updated through base/README.base.md.

Why?

baseUrl absolutizes URL fields but not the HTML inside content / description, so images and links from CMS-sourced HTML break in feed readers, which have no page to resolve them against. It is off by default because it changes existing output.

Related issue(s)

closes

Check

  • Check if duplicate PR(s) already exist.
  • Read CONTRIBUTING.md (rules)
  • Run pnpm check (lint & format)
  • Run pnpm test (functions test)
  • Run pnpm build (dist/)
  • (optional) Run pnpm test:coverage and check nothing new went uncovered

Opt-in feed option. Rewrites relative src, href, poster and srcset values inside start tags of item content and description against the base URL, in RSS, Atom and JSON Feed. Text, comments, CDATA and script/style bodies are never touched.
@github-actions github-actions Bot added enhancement New feature or request to main for Pull Request to main conflict for Pull Request labels Oct 14, 2026
@github-actions github-actions Bot removed the conflict for Pull Request label Oct 14, 2026
@otnc
otnc merged commit 51fff3c into main Oct 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request to main for Pull Request to main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant