La incrustación de JavaScript no añade la barra de directorio al importar rutas de imágenes, lo que rompe las imágenes

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: Embedded topics don't handle "//"-images properly

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)

Bueno, ha pasado un tiempo, pero sí.

El código anterior parece normalizar las URLs de imágenes que comienzan con una / (corrigiendo el nombre de host), pero no aquellas relativas a la URL actual.

¿Quizás debería ser esto en su lugar?

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

Si tengo razón, creo que el código de unas líneas más arriba tiene el mismo error.

2 Me gusta