Changeset 41435
- Timestamp:
- 09/19/2017 12:40:06 PM (7 years ago)
- Location:
- branches/4.8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
-
branches/4.8/src/wp-includes/js/mce-view.js
r40481 r41435 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 ) { -
branches/4.8/src/wp-includes/script-loader.php
r41053 r41435 950 950 'blog_id' => get_current_blog_id(), 951 951 ) ); 952 953 wp_localize_script( 'mce-view', 'mceViewL10n', array( 954 'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array() 955 ) ); 952 956 } 953 957
Note: See TracChangeset
for help on using the changeset viewer.