Ticket #26628: video-shortcode.diff
| File video-shortcode.diff, 1.8 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/formatting.php
242 242 $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed 243 243 $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee); 244 244 } 245 if ( preg_match( '|[\[<]video|', $pee ) ) { 246 $pee = preg_replace( '#\s*<(track|source)([^>]*)>\s*#', '<$1$2>', $pee ); // no pee inside video tag/shortcode 247 } 245 248 $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates 246 249 // make paragraphs, including one at the end 247 250 $pees = preg_split('/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY); … … 258 261 $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 259 262 if ( $br ) { 260 263 $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee); 264 $pee = preg_replace_callback('/[\[<]video.*?[\[<]\/video[\]>]/s', '_autop_newline_preservation_helper', $pee); 261 265 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 262 266 $pee = str_replace('<WPPreserveNewline />', "\n", $pee); 263 267 } -
src/wp-includes/media.php
1144 1144 $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) ); 1145 1145 } 1146 1146 } 1147 1148 if ( ! empty( $content ) ) { 1149 if ( false !== strpos( $content, "\n" ) ) 1150 $content = str_replace( array( "\r\n", "\n", "\t" ), '', $content ); 1151 1152 $html .= trim( $content ); 1153 } 1154 1147 1155 if ( 'mediaelement' === $library ) 1148 1156 $html .= wp_mediaelement_fallback( $fileurl ); 1149 1157 $html .= '</video>';