我使用SmpleMDE作为我的 WYSIWYG 编辑器和Parsedown库来解析 markdown 并将其转换为 HTML。
<?php echo $this->parsedown->text($post->content); ?>
一切正常,唯一的问题是我想通过添加嵌入的<iframe>
.
根据这个答案Youtube 视频和文本在 Markdown 中并排,我可以简单地将 youtube<iframe>
直接添加到我的内容中,但是输出显示 html 代码已转义
<p><iframe width="560" height="315" src="<a href="https://www.youtube.com/embed/7GqClqvlObY">https://www.youtube.com/embed/7GqClqvlObY</a>" frameborder="0" allowfullscreen></iframe></p>
数据库中的内容是这样存储的
Lorem ipsum .....
<iframe width="560" height="315" src="https://www.youtube.com/embed/7GqClqvlObY" frameborder="0" allowfullscreen></iframe>
Lorem ipsum .....
我该如何解决这个问题,以便 youtube 的嵌入代码能够正确显示?