From c3f712ac63c08a87f37b46cdbbc0b240cce6b628 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 1 Aug 2014 00:54:51 +0000 Subject: [PATCH] PressThis: when the Text editor is the default, run the initial textarea content through pre_wpautop() to convert the paragraph tags. Fixes #29081. git-svn-id: https://develop.svn.wordpress.org/trunk@29334 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/press-this.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wp-admin/press-this.php b/src/wp-admin/press-this.php index 6822941d2d..5daa2f9bbd 100644 --- a/src/wp-admin/press-this.php +++ b/src/wp-admin/press-this.php @@ -439,6 +439,8 @@ var photostorage = false; } } jQuery(document).ready(function($) { + var $contnet = $( '#content' ); + // Resize screen. window.resizeTo(760,580); @@ -460,6 +462,12 @@ var photostorage = false; $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){ $(this).siblings('.inside').toggle(); }); + + if ( $( '#wp-content-wrap' ).hasClass( 'html-active' ) && window.switchEditors && + ( tinyMCEPreInit.mceInit.content && tinyMCEPreInit.mceInit.content.wpautop ) ) { + // The Text editor is default, run the initial content through pre_wpautop() to convert the paragraphs + $contnet.text( window.switchEditors.pre_wpautop( $contnet.text() ) ); + } });