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><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> the content in database stored this
lorem ipsum ..... <iframe width="560" height="315" src="https://www.youtube.com/embed/7gqclqvloby" frameborder="0" allowfullscreen></iframe> 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
Post a Comment