Skip to content

Fix image link rewriting and size detection - #88

Open
soderlind wants to merge 2 commits into
humanmade:masterfrom
soderlind:fix/content-image-rewriting
Open

soderlind wants to merge 2 commits into
humanmade:masterfrom
soderlind:fix/content-image-rewriting

Conversation

@soderlind

Copy link
Copy Markdown

Summary

  • Match image link URLs literally and preserve replacement text containing regex metacharacters, including for Photon images.
  • Reset size matching for each image and pass the matched size name to the image-arguments filter.
  • Add regression coverage for special-character links and consecutive images.

Testing

  • Docker CI image, --filter "Tests_(Linking|Resizing)": 60 tests, 115 assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 8, 2026 17:18

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.

🟢 Approval recommended

No active review issues remain for the image-link rewriting and per-image size-detection changes.

No open issues 🎉

What changed in this PR

This PR fixes image link rewriting and size detection in Tachyon’s content filter.

Changes:

  • Match link URLs literally and preserve replacement text containing regex metacharacters for local and Photon images.
  • Reset size-matching state for each image and pass the matched size name to the image-arguments filter.
  • Add regression tests for special-character links and consecutive images.
File Description
tests/​tests/​class-tests-resizing.php Tests size-name resolution and isolation between consecutive images.
tests/​tests/​class-tests-linking.php Tests special-character link rewriting for local and Photon image sources.
inc/​class-tachyon.php Adds safe link replacement and corrects per-image size matching.

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@soderlind soderlind mentioned this pull request Nov 11, 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.

2 participants