Changeset 41395
- Timestamp:
- 09/19/2017 08:18:15 AM (7 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r41351 r41395 156 156 instance; 157 157 158 text = tinymce.DOM.decode( text );159 160 158 if ( text.indexOf( '[' ) !== -1 && text.indexOf( ']' ) !== -1 ) { 161 159 // Looks like a shortcode? Remove any line breaks from inside of shortcodes … … 432 430 var $viewNode; 433 431 434 if ( ! this.loader && $( node ).text() !== t his.text) {432 if ( ! this.loader && $( node ).text() !== tinymce.DOM.decode( this.text ) ) { 435 433 editor.dom.setAttrib( node, 'data-wpview-marker', null ); 436 434 return; … … 502 500 setIframes: function( head, body, callback, rendered ) { 503 501 var self = this; 502 503 if ( body.indexOf( '[' ) !== -1 && body.indexOf( ']' ) !== -1 ) { 504 var shortcodesRegExp = new RegExp( '\\[\\/?(?:' + window.mceViewL10n.shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' ); 505 // Escape tags inside shortcode previews. 506 body = body.replace( shortcodesRegExp, function( match ) { 507 return match.replace( /</g, '<' ).replace( />/g, '>' ); 508 } ); 509 } 504 510 505 511 this.getNodes( function( editor, node ) { -
trunk/src/wp-includes/script-loader.php
r41390 r41395 1059 1059 'blog_id' => get_current_blog_id(), 1060 1060 ) ); 1061 1062 wp_localize_script( 'mce-view', 'mceViewL10n', array( 1063 'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array() 1064 ) ); 1061 1065 } 1062 1066
Note: See TracChangeset
for help on using the changeset viewer.