Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Local image exists check fails for local images' srcset attribute #7
If an image exists locally and is output with a srcset attribute, it fails the local_image_exists check, so the plugin replaces the URLs in the srcset with the production URL.
It looks like this is because the
which will not return true for the file existing.
Actually, I think all that needs to happen is to change line 159 to this:
Related: local images used in the WordPress core cover block (as a background) end up failing the local_image_exists check as well because the regex done on images in the content doesn't remove the trailing
One way to fix it would be to just strip any
but there may be a better way to resolve that in the regex itself; my regex wobbles. But adding this line above the