Title: [Plugin: WP-Markdown] Breaks oEmbed support
Last modified: August 20, 2016

---

# [Plugin: WP-Markdown] Breaks oEmbed support

 *  [_](https://wordpress.org/support/users/viniciusmassuchetto/)
 * (@viniciusmassuchetto)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/)
 * Your plugin is awesome, but it seems to break the oEmbed support.
 * If I paste a Youtube or Tweet URL, it will wrap it as a “<p>”, and then WordPress
   wont’t render the desired iframe object. Is that a known issue?
 * Thanks for this plugin.
 * [http://wordpress.org/extend/plugins/wp-markdown/](http://wordpress.org/extend/plugins/wp-markdown/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [_](https://wordpress.org/support/users/viniciusmassuchetto/)
 * (@viniciusmassuchetto)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931612)
 * _[ Moderator Note: Please post code or markup snippets between backticks or
    
   use the code button. ]
 * According to the markdown syntax, we can ignore some block putting it inside 
   a `<div>`. So, this works:
 *     ```
       <div>
       https://twitter.com/vmassuchetto/status/230155348680519680
       http://www.youtube.com/watch?v=0Uv6EVdAo48
       </div>
       ```
   
 * However, it would be interesting for the plugin to correctly render previously
   inserted oEmbed items.
 * Still working on it…
 *  Thread Starter [_](https://wordpress.org/support/users/viniciusmassuchetto/)
 * (@viniciusmassuchetto)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931613)
 * A small function to ensure oEmbed works. I’ll be using it on [my theme](http://vinicius.soylocoporti.org.br/monospace2-wordpress-theme/)
   until this is fixed (or not) in WP-Markdown.
 * Thanks!
 *     ```
       add_filter('the_content', 'monospace_ensure_oembed', 1);
       function monospace_ensure_oembed($content) {
           return preg_replace('/^\s*<[^>]*>(http.*)?<[^>]*>\s*$/im', '\1' . "\n", $content);
       }
       ```
   
 *  Plugin Author [Stephen Harris](https://wordpress.org/support/users/stephenh1988/)
 * (@stephenh1988)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931678)
 * Hi Vinicius
    Thanks for flagging this. I’ve actually got a fix ready, so expect
   an update soon!
 *  Thread Starter [_](https://wordpress.org/support/users/viniciusmassuchetto/)
 * (@viniciusmassuchetto)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931695)
 * The version 1.1.4 fixes the oEmbed support but somehow strips line breaks in 
   code blocks. Can you please confirm this?
 * Thanks.
 *  Plugin Author [Stephen Harris](https://wordpress.org/support/users/stephenh1988/)
 * (@stephenh1988)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931696)
 * Unfortunately, yes it does. I am just about to release a fix. Thanks for reporting
   this – I should have been more thorough in my testing.
 * An immediate fix is to either remove the oEmbed support by commenting out these
   two lines 69 and 72 in [here](https://github.com/stephenh1988/WP-MarkDown/blob/1.1.4/wp-markdown.php#L69).
 * Or comment out the line causing the bug here on [line 252](https://github.com/stephenh1988/WP-MarkDown/blob/1.1.4/wp-markdown.php#L252).
 *  Plugin Author [Stephen Harris](https://wordpress.org/support/users/stephenh1988/)
 * (@stephenh1988)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931715)
 * Unfortunately, given the bugs that have been introduced (one has been fixed in
   1.1.5 – the other cannot be, it seems). I am going to have to revert oEmbed support(
   as it currently is). However, you can still used oEmbed, but you’ll need to use
   the shortcode `[embed]`. This is part of WordPress core, so you can start using
   it now.
 *  Thread Starter [_](https://wordpress.org/support/users/viniciusmassuchetto/)
 * (@viniciusmassuchetto)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931719)
 * No problem. Even being a reverse solution, the function I just pasted above works.
   I’ll be using it just fine.
 * What’s the problem with oEmbed? I can try to help you with that.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: WP-Markdown] Breaks oEmbed support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-markdown_d5ecec.svg)
 * [WP-Markdown](https://wordpress.org/plugins/wp-markdown/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-markdown/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-markdown/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-markdown/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-markdown/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-markdown/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [_](https://wordpress.org/support/users/viniciusmassuchetto/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-breaks-oembed-support/#post-2931719)
 * Status: not resolved