JavaScript embedding doesn't add directory slash importing image paths, breaks images

Well, it’s been a while, but yes.

The above code appears to normalize image URLs that start with a / (fixing up the hostname), but not those relative to the current URL.

Maybe that should instead be this?

    if src.present? && !src.start_with?('http')

If I’m right, I think that the code a few lines above has the same bug.

2 Likes