Skip to content

Escape file names in processed links#8660

Merged
alexr00 merged 1 commit intomainfrom
alexr00/rainy-horse
Apr 13, 2026
Merged

Escape file names in processed links#8660
alexr00 merged 1 commit intomainfrom
alexr00/rainy-horse

Conversation

@alexr00
Copy link
Copy Markdown
Member

@alexr00 alexr00 commented Apr 13, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 13, 2026 11:05
@alexr00 alexr00 enabled auto-merge (squash) April 13, 2026 11:05
@alexr00 alexr00 self-assigned this Apr 13, 2026
@alexr00 alexr00 added this to the 1.116.0 milestone Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens processed GitHub blob/diff link rendering by HTML-escaping file path/name values before placing them into data-local-file attributes, preventing attribute-breaking characters from producing malformed HTML.

Changes:

  • Added an escapeHtmlAttr helper for escaping HTML attribute values.
  • Escaped data-local-file values generated by processPermalinks.
  • Escaped data-local-file values generated by processDiffLinks.
Show a summary per file
File Description
src/common/utils.ts Escapes file paths/names before embedding them into generated link HTML attributes.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread src/common/utils.ts
Comment thread src/common/utils.ts
@alexr00 alexr00 merged commit cafbd94 into main Apr 13, 2026
10 checks passed
@alexr00 alexr00 deleted the alexr00/rainy-horse branch April 13, 2026 14:36
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.

3 participants