WAIT: Spaces in srcset are replaced by %20

Browser: Chrome 110
OS: Windows

When the srcset attribute is added manually, the space between the url and xW in the output HTML is replaced with %20, causing the browser to not recognize the srcset attribute. I tried writing the space as “& nbsp;” and that didn’t work either.

For example: https://jdhjfdd.com/aa.png-1200x1200 1200w, https://jdhjfdd.com/aa.png-800x800 800w will be output as
https://jdhjfdd.com/aa.png-1200x1200%201200w,%20https://jdhjfdd.com/aa.png-800x800%20800w

Hi,
Thanks so much for your report!

Unfortunately, I cannot reproduce the issue. Would you be so kind as to provide a live link and a screencast using https://jam.dev showing and explaining every step?

Best regards,
timmse

Hi @timmse ,
Here’s a video of the screen I just recorded. You can see that the spaces in the srcset in the html are wrong.

If you copy your code into a real code editor (vs code, sublime text, atom, …), you will probably also see line breaks there. If you remove them, I think the problem will solve itself.

Alternatively, copy this:

https://wordpress-1059008-4334197.cloudwaysapps.com/wp-content/uploads/2022/01/Transit-van-window-covers-with-bug-screen-kit-3-piece-2015-2019-1200x1200.png 1200w, https://wordpress-1059008-4334197.cloudwaysapps.com/wp-content/uploads/2022/01/Transit-van-window-covers-with-bug-screen-kit-3-piece-2015-2019-800x800.png 800w

Please forgive my lack of programming expertise.

But I copied this little paragraph you provided and still have the same problem.

What I’m really trying to fix is that the last clip in the video uses dynamic data - {echo: get_custom_loop_object_property(image-srcset)} to output the srcset property without the %20.

Hey Ying, all good. That shouldn’t be a reproach. However, I still can’t reproduce the problem.

Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

Hi Timmse, I just sent the login link to the help email. Please check it. Thanks!