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

This looks like… a simple bug?

Note the slash missing in “catmedia”.

I didn’t find a report for this bug, although this one might be related: https://meta.discourse.org/t/embedded-topics-dont-handle-images-properly/37355

Can anyone reproduce? Or is there a fix that we could implement on our side? (other than defining images with absolute URLs, which we could do moving forward but what about the articles already published)

오랜만이긴 하지만, 네요.

위 코드는 /로 시작하는 이미지 URL을 정규화(호스트명 수정)하는 것처럼 보이지만, 현재 URL에 상대적인 URL은 처리하지 않습니다.

대신 이렇게 해야 하는 것 아닌가요?

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

제가 맞다면, 몇 줄 위 코드에도 동일한 버그가 있는 것 같습니다.

2개의 좋아요