php - SimpleMDE - Markdown embeding videos from Youtube -


i 'm using smplemde wysiwyg editor , parsedown library parsing markdown , converting html.

<?php echo $this->parsedown->text($post->content); ?>

everything works fine, problem want show youtube videos within content adding embeded <iframe>.

according answer youtube video , text side side in markdown can add youtube <iframe> straight content, output shows html code escaped

<p>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;<a href="https://www.youtube.com/embed/7gqclqvloby">https://www.youtube.com/embed/7gqclqvloby</a>&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;</p> 

the content in database stored this

lorem ipsum .....  &lt;iframe width="560" height="315" src="https://www.youtube.com/embed/7gqclqvloby" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;   lorem ipsum ..... 

how can fix embeded code youtube show properly?

since problem strings stored escaped in database, try this:

<?php echo $this->parsedown->text(htmlspecialchars_decode($post->content); ?> 

also, take @ manual, might have add flag depending on how strings encoded/escaped.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -