WordPress.org

Support

Support » Plugins and Hacks » Jetpack by WordPress.com » [Resolved] Adding Markdown support to Plugins: Paragraphs

[Resolved] Adding Markdown support to Plugins: Paragraphs

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    Plugin Contributor Richard Archambault

    @richardmtl

    Happiness Engineer

    Great post, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Adding Markdown support to Plugins: Paragraphs’ is closed to new replies.
Skip to toolbar