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

**URL:** <https://meta.discourse.org/t/vimeo-embed-urls-parsed-incorrectly-in-email/231042>\
**Category:** Bug\
**Created:** [24 يونيو 2022، 5:56م UTC](https://meta.discourse.org/t/vimeo-embed-urls-parsed-incorrectly-in-email/231042 "2022-06-24T17:56:20Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ghassan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ghassan/32/263566_2.png) [@ghassan](https://meta.discourse.org/u/ghassan)\
**Post date:** [6 نوفمبر 2022، 11:57ص UTC](https://meta.discourse.org/t/vimeo-embed-urls-parsed-incorrectly-in-email/231042/12 "2022-11-06T11:57:47Z")

</div>

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

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

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

> <https://github.com/discourse/discourse/blob/dea44ec923b1f4fced6dafbbf8109820cf1ca7a4/lib/pretty_text.rb#L479-L490>

على سبيل المثال، إذا قمت بفحص أدوات المطور/عنصر الفحص من متصفحك، فإن كود 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>`

```html
<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`.

```html
<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 لا يسمح لك بإضافة أي سمة تريدها…

---

_[View the full topic](https://meta.discourse.org/t/vimeo-embed-urls-parsed-incorrectly-in-email/231042)._
