WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Adding Markdown support to Plugins: Paragraphs (3 posts)

  1. jezza101
    Member
    Posted 6 months ago #

    I have added markdown support to a meta field in a custom plugin using the suggestion here.

    WPCom_Markdown::get_instance()->transform( $content )

    This works fine with the exception of paragraphs (I understand these are inserted by inserting two or more spaces and pressing return).

    In the above example, $content is simply the contents of a post meta field collected from a text area. I then echo the result of the transform. Note that I do set unslash to false as I am using the content of my meta form directly.

    Paragraphs aren't showing up, and whats more I can't even use html p tags! Any suggestions?

    Many thanks.

    https://wordpress.org/plugins/jetpack/

  2. jezza101
    Member
    Posted 6 months ago #

    I worked it out.

    Turns out this is less to do with JetPack and more with how WordPress handles paragraphs and sanitisation of meta fields.

    I added the solution to my post on the topic here. Hope that is useful to someone in the future :)

    Cheers.

  3. Richard Archambault
    Happiness Engineer
    Plugin Author

    Posted 5 months ago #

    Great post, thanks!

Reply

You must log in to post.

About this Plugin

About this Topic