WordPress.org

Ready to get started?Download WordPress

Forums

WP-Markdown
Breaks oEmbed support (8 posts)

  1. viniciusmassuchetto
    Member
    Posted 1 year ago #

    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/

  2. viniciusmassuchetto
    Member
    Posted 1 year ago #

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

  3. viniciusmassuchetto
    Member
    Posted 1 year ago #

    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);
    }
  4. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

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

  5. viniciusmassuchetto
    Member
    Posted 1 year ago #

    The version 1.1.4 fixes the oEmbed support but somehow strips line breaks in code blocks. Can you please confirm this?

    Thanks.

  6. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  7. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  8. viniciusmassuchetto
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic