تم تحليل روابط تضمين Vimeo بشكل غير صحيح في البريد الإلكتروني

أها، وجدت المشكلة الآن:

إذًا ما يحدث هو أنه عند لصق كود iframe عادي، فقد تتجاوز كود onebox، وإذا قمت بتمريره فلن يحتوي كود iframe الناتج على data-original-href وهو الرابط المستخدم في قالب البريد الإلكتروني.

وعندما يكون data-original-href مفقودًا، يحاول discourse تخمين الفيديو، وهو ما يأتي بعد الشرطة المائلة الأخيرة، وهذا بالطبع لا يغطي حالة الفيديو غير المدرج.

على سبيل المثال، إذا قمت بفحص أدوات المطور/عنصر الفحص من متصفحك، فإن كود iframe الناتج عند استخدام كود iframe عادي:

<iframe src="https://player.vimeo.com/video/508864124?h=fcbbcc92fa" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>

<iframe src="https://player.vimeo.com/video/508864124?h=fcbbcc92fa" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen=""></iframe>

بينما عند لصق رابط URL فقط، أي، دع discourse يحوله إلى iframe
https://vimeo.com/508864124/fcbbcc92fa.

<iframe class="vimeo-onebox" src="https://player.vimeo.com/video/508864124?h=fcbbcc92fa&amp;app_id=122963" data-original-href="https://vimeo.com/508864124/fcbbcc92fa" frameborder="0" allowfullscreen="" seamless="seamless" sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"></iframe>

لذا لاحظ data-original-href="https://vimeo.com/508864124/fcbbcc92fa" الإضافي في الناتج الثاني، قد يخمن المرء أنه إذا كان هذا السمة عند استخدام iframe عادي فسيعمل، ولكنه لا يعمل ربما لأن discourse لا يسمح لك بإضافة أي سمة تريدها…