دمج JavaScript لا يضيف شرطة مائلة للدليل عند استيراد مسارات الصور، مما يكسر الصور

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)

حسنًا، لقد مرّ وقت طويل، لكن نعم.

يبدو أن الكود أعلاه يقوم بتطبيع عناوين URLs للصور التي تبدأ بـ / (إصلاح اسم المضيف)، لكنه لا يفعل ذلك مع تلك النسبية بالنسبة للرابط الحالي.

ربما يجب أن يكون ذلك بدلاً من ذلك هكذا؟

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

إذا كنت محقًا، أعتقد أن الكود الموجود في الأسطر القليلة أعلاه يحتوي على نفس الخطأ.

إعجابَين (2)