Skip to content

fix: escape footnote tooltip content in aria-label#1238

Merged
zkqiang merged 1 commit intofluid-dev:developfrom
xwbcl123:fix/escape-footnote-tooltip-attrs
Mar 9, 2026
Merged

fix: escape footnote tooltip content in aria-label#1238
zkqiang merged 1 commit intofluid-dev:developfrom
xwbcl123:fix/escape-footnote-tooltip-attrs

Conversation

@xwbcl123
Copy link
Copy Markdown
Contributor

@xwbcl123 xwbcl123 commented Mar 8, 2026

Summary

  • escape footnote tooltip text before inserting it into aria-label
  • prevent footnote hover markup from breaking when the footnote content contains quotes

Problem

The footnote tooltip renderer currently does stripHTML() and then injects the result directly into:

<span class="hint--top hint--rounded" aria-label="...">

If the footnote content contains quotes, the generated aria-label can break and the hover span markup may be rendered as visible text instead of a tooltip.

Reproduction

A footnote like this is enough to trigger it:

[^4]: ... Jim Nightingale ("Jim the AI Whisperer") ...
[^5]: ... internal Agent "Goose" ...

Fix

Apply HTML attribute escaping to the stripped footnote text before concatenating it into aria-label.

Validation

  • reproduced the issue in a local Hexo site using Fluid
  • rebuilt the site after the patch
  • verified that the generated footnote refs now render as valid tooltip markup
  • verified that no leaked <span class=...> text appears in the page body

@zkqiang zkqiang changed the base branch from master to develop March 9, 2026 17:02
@zkqiang zkqiang merged commit c81c14e into fluid-dev:develop Mar 9, 2026
1 of 2 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.

2 participants