diff --git a/admin/jpbeta-admin-main.php b/admin/jpbeta-admin-main.php index c9f2aaf9a13a1..d8b25c1c29598 100644 --- a/admin/jpbeta-admin-main.php +++ b/admin/jpbeta-admin-main.php @@ -32,6 +32,26 @@ margin-top: 15px; } + .jetpack_page_jetpack-beta .card ul { + list-style-type: disc; + } + + .jetpack_page_jetpack-beta .card #jp_beta_choose_type ul { + list-style-type: none; + } + + .j-beta-wrap .card pre code { + display: block; + } + + .j-beta-wrap .card pre { + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ + } + .jetpack_page_jetpack-beta .card .feedback { margin-top: 20px; font-size: 18px; diff --git a/jetpack-beta.php b/jetpack-beta.php index 4eedd3b0b697e..84ed3ab541182 100644 --- a/jetpack-beta.php +++ b/jetpack-beta.php @@ -96,37 +96,59 @@ function load_debug_bar_jpa_info() { add_action( 'admin_init', 'load_debug_bar_jpa_info' ); function jpbeta_get_testing_list() { - $test_list_path = WP_PLUGIN_DIR . '/jetpack/to-test.txt'; + $test_list_path = WP_PLUGIN_DIR . '/jetpack/to-test.md'; if ( ! file_exists( $test_list_path ) ) { return "You're not currently using a beta version of Jetpack"; } - $test_list_file = file_get_contents( $test_list_path ); - $test_list_rows = explode( "\n", $test_list_file ); - - - unset( $test_list_rows[0] ); - unset( $test_list_rows[1] ); - unset( $test_list_rows[2] ); - - $o = ''; - - foreach( $test_list_rows as $row ) { - if( strpos( $row, '===' ) === 0 ) { - if( $o ) { - $o .= ''; - break; + + $test_list_file = file_get_contents( $test_list_path ); + + if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'markdown' ) ) { + + // We'll apply standard content filters to our content. + add_filter( 'jetpack_beta_test_content', 'wptexturize' ); + add_filter( 'jetpack_beta_test_content', 'convert_smilies' ); + add_filter( 'jetpack_beta_test_content', 'convert_chars' ); + add_filter( 'jetpack_beta_test_content', 'wpautop' ); + add_filter( 'jetpack_beta_test_content', 'shortcode_unautop' ); + add_filter( 'jetpack_beta_test_content', 'prepend_attachment' ); + + // Then let's use Jetpack Markdown to process our content + jetpack_require_lib( 'markdown' ); + $o = WPCom_Markdown::get_instance()->transform( $test_list_file, array('id'=>false,'unslash'=>false) ); + $o = apply_filters( 'jetpack_beta_test_content', $o ); + + } else { + + $test_list_rows = explode( "\n", $test_list_file ); + + unset( $test_list_rows[0] ); + unset( $test_list_rows[1] ); + unset( $test_list_rows[2] ); + + $o = sprintf( + __( "
' . trim( str_replace( '*', '', $row ) ) . '
'; + } else { + $o .= '' . $row . '
' . trim( str_replace( '*', '', $row ) ) . '
'; - } else { - $o .= '' . $row . '