Skip to content

Escape image titles and alt text in Markdown - #493

Merged
djmb merged 2 commits into
mainfrom
image-markdown-escape
Sep 29, 2026
Merged

djmb merged 2 commits into
mainfrom
image-markdown-escape

Conversation

@djmb

@djmb djmb commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

A double quote in an image's title or alt text ended the HTML attribute
early, so the title was cut short and the rest of the text leaked into
the tag's markup. Escape the URL, title and alt text before they go into
the link and image tags.

A double quote in an image's title or alt text ended the HTML attribute
early, so the title was cut short and the rest of the text leaked into
the tag's markup. Escape the URL, title and alt text before they go into
the link and image tags.
Copilot AI balanced review requested due to automatic review settings September 29, 2026 11:05
@djmb

djmb commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @codex review. Don't run the tests.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T11:13:11.429123Z 824ba3d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The test does not exercise the newly added URL escaping behavior.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Escapes Markdown image attributes to prevent malformed or injected HTML.

Changes:

  • Escapes image URLs, titles, and alt text.
  • Adds regression coverage for title and alt-text injection.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
lib/​markdown_renderer.rb Escapes values before HTML interpolation.
test/​lib/​markdown_renderer_test.rb Tests image attribute escaping.

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

Comment thread test/lib/markdown_renderer_test.rb Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b4aac7b27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/markdown_renderer.rb Outdated
@djmb

djmb commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @codex review. Don't run the tests.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 824ba3d25e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@djmb
djmb merged commit f3fadd2 into main Sep 29, 2026
7 checks passed
@djmb
djmb deleted the image-markdown-escape branch September 29, 2026 11:13
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