Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions modules/markdown/easy-markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,9 @@ public function transform( $text, $args = array() ) {
'unslash' => true,
'decode_code_blocks' => ! $this->get_parser()->use_code_shortcode
) );
// probably need to unslash
if ( $args['unslash'] )

// If unslash is not true, strip the slashes
if ( empty( $args['unslash'] ) || false == 'unslash' )
$text = wp_unslash( $text );

$text = apply_filters( 'wpcom_markdown_transform_pre', $text, $args );
Expand All @@ -530,7 +531,7 @@ public function transform( $text, $args = array() ) {
$text = apply_filters( 'wpcom_markdown_transform_post', $text, $args );

// probably need to re-slash
if ( $args['unslash'] )
if ( empty( $args['unslash'] ) || false == 'unslash' )
$text = wp_slash( $text );

return $text;
Expand Down Expand Up @@ -659,8 +660,10 @@ protected function swap_for_editing( $post ) {
$markdown = $this->get_parser()->codeblock_restore( $markdown );
// restore beginning of line blockquotes
$markdown = preg_replace( '/^> /m', '> ', $markdown );

$post->post_content_filtered = $post->post_content;
$post->post_content = $markdown;
$post->post_content = wp_slash( $markdown );

return $post;
}

Expand Down