Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter _

    (@viniciusmassuchetto)

    [ 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 _

    (@viniciusmassuchetto)

    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!

    Thread Starter _

    (@viniciusmassuchetto)

    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.

    Thread Starter _

    (@viniciusmassuchetto)

    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.