WordPress.org

Support

Support » Plugins and Hacks » WP-Markdown » [Plugin: WP-Markdown] Breaks oEmbed support

[Plugin: WP-Markdown] Breaks oEmbed support

Viewing 7 replies - 1 through 7 (of 7 total)
  • [ 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>
    
    
    </div>

    However, it would be interesting for the plugin to correctly render previously inserted oEmbed items.

    Still working on it…

    A small function to ensure oEmbed works. I’ll be using it on my 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

    @stephenh1988

    Hi Vinicius
    Thanks for flagging this. I’ve actually got a fix ready, so expect an update soon!

    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

    @stephenh1988

    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.

    Or comment out the line causing the bug here on line 252.

    Plugin Author Stephen Harris

    @stephenh1988

    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.

    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.
Skip to toolbar