首页 > 解决方案 > bootstrap-wysihtml5 改变 iframe src

问题描述

我想在 wysihtml5 编辑器中使用 Youtube abd Vimeo iframe 代码。我用过

('#answer').wysihtml5();

$('#answer').wysihtml5({
      toolbar: {
        "font-styles": true, // Font styling, e.g. h1, h2, etc.
        "emphasis": true, // Italics, bold, etc.
        "lists": true, // (Un)ordered lists, e.g. Bullets, Numbers.
        "html": true, // Button which allows you to edit the generated HTML.
        "link": true, // Button to insert a link.
        "image": true, // Button to insert an image.
        "color": false, // Button to change color of font
        "blockquote": true, // Blockquote
        "size": "sm" // options are xs, sm, lg
      }
    });

遵循我正在使用的 iframe 代码

<iframe width="560" height="315" src="https://www.youtube.com/embed/zJZKWF7YBas" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

在数据库中,我看到它如下

<p>&lt;iframe width="560" height="315" src="<a href="https://www.youtube.com/embed/zJZKWF7YBas&quot;">https://www.youtube.com/embed/zJZKWF7YBas"</a>; frameborder="0" allow="autoplay; encrypted-media" allowfullscreen&gt;&lt;/iframe&gt;?<br></p>

表示它已转换 iframe src

在屏幕上,我看到它如下所示。

<iframe width="560" height="315" src="https://www.youtube.com/embed/zJZKWF7YBas"; frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>?

所以我的问题是为什么 wysihtml5 正在改变 iframe src 以及如何阻止它?

标签: phphtmliframelaravel-5.4wysihtml5

解决方案


推荐阅读