Odd parsing of image extensions in text blocks
It was reported that there is an odd parsing of image extensions when they happen in regular text blocks like this:
- "Mike Gif?raw=trueford" instead of "Mike Gifford" on this page
- "both original MD and screenshotted PNG?raw=true format" instead of both original MD and screenshotted PNG format" on this page
I've narrowed it down to the plugin that was built for us from the LF years ago, and have been digging into the code to see where this might be originating from. This only happens when the content of the WP page is pulled dynamically from a GitHub markdown file, not when something is built in WP itself.
Dropping this issue for when I have more time to look at this, as I've already spent a few hours digging and diagnosing. :blush:
Is the source for this custom plugin available somewhere in a gut repo? Or is it just a one-off and needs to be edited directly in the WP instance
It looks like its doing a really dumb text search for common image extensions (gif, png, etc) and blindly adding the ?raw=true without confirming an image is present
@MoralCode supposedly it's available in the WP interface directly, so that's where I've been accessing it. It is using Parsedown for the heavy lifting, but I don't know that the WP interface provides me access to all the files in the plugin.
It looks like its doing a really dumb text search for common image extensions (gif, png, etc) and blindly adding the ?raw=true without confirming an image is present
🎯 🤦♀️
But nowhere in the codebase can I find a regex for this, or even any coded reference to gifs, jpegs, pngs etc. Also the source code for one of the pages where this happens (view-source:https://chaoss.community/practitioner-guide-demonstrating-org-value/) has numerous debug scripts being run, and in some of those outputs, the text is parsed correctly. 🥴 (So it ends up being 2300 lines of code for this simple webpage).
do you have a link to this codebase you were looking through?