Vimeo嵌入URL在邮件中解析错误

找到了问题:
所以发生的情况是,当您粘贴 vanilla iframe 代码时,您可能会绕过 onebox 代码,如果您传递它,则结果 iframe 代码将没有 data-original-href,这是电子邮件模板中使用的链接。

当缺少 data-original-href 时,discourse 会尝试猜测视频是最后一个 / 之后的内容,这当然不包括未列出的视频。

例如,如果您从浏览器检查开发工具/检查元素,当使用 vanilla 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",有人可能会猜测当使用 vanilla iframe 时,如果该属性起作用,但它可能不起作用,因为 discourse 不允许您添加任何您想要的属性…