Files
RedwindA 6e40d9a639 fix(web): 自定义页脚 HTML 改走 HtmlContent 消毒渲染 (#8558)
* fix(web): sanitize custom footer HTML through HtmlContent

The footer was the only admin-configured HTML still injected with raw
dangerouslySetInnerHTML; it predates the shared HtmlContent hardening
(#5760, 626dadb55) and was never moved over, so inline handlers such as
<img onerror> ran on the home page.

Render it with the isolated HtmlContent variant used by the home, about
and legal pages: DOMPurify strips handlers, target=_blank links get
noopener noreferrer, and Shadow DOM keeps the footer's existing look.
sm:w-auto keeps the attribution column on one line beside it.

Also key the demo-site footer columns by title/href instead of array
index to clear the file's lint errors.

* fix(web): render sanitized footer HTML in the page DOM

The isolated variant put the footer in a Shadow DOM, which cut it off from
the page: in-page anchors to ids in the footer stopped resolving, a lone
badge lost its centering on mobile, theme presets no longer reached links
using the theme colors, and site CSS such as `.custom-footer a` stopped
applying.

Add an `embedded` HtmlContent variant that keeps the isolated variant's
sanitizing (handlers stripped, new-tab links get noopener noreferrer) but
renders into the page DOM, and use it for the footer. The footer no longer
needs the sm:w-auto width fix.
2026-12-05 15:26:40 +08:00
..
2026-09-20 17:51:52 +08:00