Skip to content

Fix HTML entities in sanitized titles - #3216

Merged
SamMorrowDrums merged 1 commit into
mainfrom
sammorrowdrums-fix-title-sanitization
Sep 3, 2026
Merged

Fix HTML entities in sanitized titles#3216
SamMorrowDrums merged 1 commit into
mainfrom
sammorrowdrums-fix-title-sanitization

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Summary

  • add an entity-aware plain-text sanitizer that preserves visible quotes, apostrophes, and ampersands
  • apply it to issue, pull request, discussion, release, headline, and validation-text surfaces without changing Markdown body sanitization
  • cover raw and encoded HTML, character entities, malformed input, invisible characters, idempotence, and exact tool output

Testing

  • script/lint
  • script/test

Fixes #3214

Add an entity-aware plain-text sanitizer for titles, release names, headlines, and validation text while keeping encoded markup inert and Markdown body handling unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 11:33
@SamMorrowDrums
SamMorrowDrums requested a review from a team as a code owner September 3, 2026 11:33

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 review overview

🔵 Needs a closer look

The sanitization changes span multiple user-facing surfaces and require final human review.

Review tier: Balanced
Findings: None

What changed in this PR

Adds entity-aware plain-text sanitization while preserving Markdown body behavior.

Changes:

  • Introduces and tests sanitize.PlainText.
  • Applies sanitization to titles, release names, headlines, and validation errors.
  • Adds regression coverage for punctuation preservation and exact output.
File Description
pkg/​sanitize/​sanitize.go Implements entity-aware plain-text sanitization.
pkg/​sanitize/​sanitize_test.go Tests entities, malformed input, security, and idempotence.
pkg/​github/​sanitize_coverage_test.go Verifies sanitization and serialized output.
pkg/​github/​repositories.go Sanitizes blame commit headlines.
pkg/​github/​minimal_types.go Updates title and release-name conversions.
pkg/​github/​issues.go Updates issue and parent-title sanitization.
pkg/​github/​discussions.go Updates discussion-title sanitization.
pkg/​errors/​error.go Updates validation-text sanitization.
pkg/​errors/​error_test.go Tests preserved validation-error punctuation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SamMorrowDrums
SamMorrowDrums merged commit f2cbc12 into main Sep 3, 2026
20 checks passed
@SamMorrowDrums
SamMorrowDrums deleted the sammorrowdrums-fix-title-sanitization branch September 3, 2026 13:15
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