diff --git a/jetpack/lib/markdown/gfm.php b/jetpack/lib/markdown/gfm.php index 0043b7c..f906785 100644 --- a/jetpack/lib/markdown/gfm.php +++ b/jetpack/lib/markdown/gfm.php @@ -365,7 +365,7 @@ public function _doFencedCodeBlocks_callback( $matches ) { if ( $classname{0} == '.' ) $classname = substr( $classname, 1 ); - $codeblock = esc_html( $codeblock ); + // $codeblock = esc_html( $codeblock ); $codeblock = sprintf( $this->shortcode_start, $classname ) . "\n{$codeblock}" . $this->shortcode_end; return "\n\n" . $this->hashBlock( $codeblock ). "\n\n"; } diff --git a/jetpack/markdown/easy-markdown.php b/jetpack/markdown/easy-markdown.php index a94f5b8..0bc2c57 100644 --- a/jetpack/markdown/easy-markdown.php +++ b/jetpack/markdown/easy-markdown.php @@ -122,7 +122,9 @@ public function load_markdown_for_posts() { add_action( 'wp_restore_post_revision', array( $this, 'wp_restore_post_revision' ), 10, 2 ); add_filter( '_wp_post_revision_fields', array( $this, '_wp_post_revision_fields' ) ); add_action( 'xmlrpc_call', array( $this, 'xmlrpc_actions' ) ); - add_filter( 'content_save_pre', array( $this, 'preserve_code_blocks' ), 1 ); + if ( ! class_exists( 'SyntaxHighlighter' ) ) { + add_filter( 'content_save_pre', array( $this, 'preserve_code_blocks' ), 1 ); + } if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { $this->check_for_early_methods(); } diff --git a/wp-markdown-editor.php b/wp-markdown-editor.php index 200d870..7aaa473 100644 --- a/wp-markdown-editor.php +++ b/wp-markdown-editor.php @@ -1,6 +1,6 @@ plugin_url('/simplemde/simplemde.min.js')); + if (!post_type_supports( get_post_type(), WPCom_Markdown::POST_TYPE_SUPPORT )){ + return; + } + + wp_enqueue_script('simplemde-js', $this->plugin_url('/simplemde/simplemde.min.js')); wp_enqueue_style('simplemde-css', $this->plugin_url('/simplemde/simplemde.min.css')); wp_enqueue_style('custom-css', $this->plugin_url('/style.css')); } @@ -111,6 +115,10 @@ function init_editor() return; } + if (!post_type_supports( get_post_type(), WPCom_Markdown::POST_TYPE_SUPPORT )){ + return; + } + echo '