Skip to content

Conversation

@ddegner
Copy link
Owner

@ddegner ddegner commented Aug 11, 2025

Fixes wrapContentImages() to correctly process images with query strings and avoid skipping valid <img> tags due to unrelated <picture> or AVIF content.

The original wrapContentImages() function had a global early-return that prevented any image wrapping if the content contained <picture> or type="image/avif". This meant that even plain <img> tags would not be processed if these elements were present elsewhere. Additionally, the regex used to find <img> tags did not account for query strings after the file extension, causing images like image.jpg?ver=123 to be missed. This PR addresses both issues by removing the global early-return, processing all <img> tags while skipping only those already nested within a <picture>, and updating the regex to correctly match URLs with query strings. It also ensures avifUrlFor() handles query strings correctly.


Open in Cursor Open in Web

…nd picture tags

Co-authored-by: dingoes-51.slots <dingoes-51.slots@icloud.com>
@cursor
Copy link

cursor bot commented Aug 11, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: dingoes-51.slots <dingoes-51.slots@icloud.com>
@ddegner ddegner marked this pull request as ready for review August 11, 2025 19:38
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