Skip to content

fix(sanitize): preserve visible characters in title fields - #3215

Closed
baggiiiie wants to merge 1 commit into
github:mainfrom
baggiiiie:fix-sanitize-title-html-entities
Closed

fix(sanitize): preserve visible characters in title fields#3215
baggiiiie wants to merge 1 commit into
github:mainfrom
baggiiiie:fix-sanitize-title-html-entities

Conversation

@baggiiiie

@baggiiiie baggiiiie commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Narrow fix for HTML entity leakage in title-like GitHub MCP response fields.

  • keep strict sanitize.Sanitize behavior for Markdown/code-bearing bodies
  • route short metadata (issue/PR/discussion titles, release names, blame headlines, and validation error text) through sanitize.Title
  • restore only apostrophe, quote, and ampersand entities after the HTML policy, leaving < / > escaped so nested entity payloads cannot reconstitute markup
  • cover converter paths, search marshaling, and discussion/parent-issue title surfaces

Scope intentionally excluded

this PR follows #3177. Pre-existing unsanitized title-like fields such as project titles and milestones are also left unchanged.

Validation

  • focused fidelity, nested-encoding, and converter regression tests in pkg/sanitize and pkg/github

Fixes #3214

HTML sanitization was encoding apostrophes and other punctuation as
entities in title fields. Route title-like metadata through a Title
helper that restores that visible text after the strict policy runs.
@baggiiiie
baggiiiie requested a review from a team as a code owner September 3, 2026 09:12
Copilot AI balanced review requested due to automatic review settings September 3, 2026 09:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baggiiiie

Copy link
Copy Markdown
Author

Closing in favor of #3216, which already merged the same #3214 fix (sanitize.PlainText for title-like fields). This branch now conflicts with main and has no remaining unique change worth reconciling.

@baggiiiie baggiiiie closed this Sep 3, 2026
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.

Title sanitization returns HTML entities in tool output

2 participants