Changeset 41436 for branches/4.7
- Timestamp:
- 09/19/2017 12:40:10 PM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
src/wp-includes/js/mce-view.js (modified) (3 diffs)
-
src/wp-includes/script-loader.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/src/wp-includes/js/mce-view.js
r40482 r41436 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 … … 431 429 var $viewNode; 432 430 433 if ( ! this.loader && $( node ).text() !== t his.text) {431 if ( ! this.loader && $( node ).text() !== tinymce.DOM.decode( this.text ) ) { 434 432 editor.dom.setAttrib( node, 'data-wpview-marker', null ); 435 433 return; … … 494 492 setIframes: function( head, body, callback, rendered ) { 495 493 var self = this; 494 495 if ( body.indexOf( '[' ) !== -1 && body.indexOf( ']' ) !== -1 ) { 496 var shortcodesRegExp = new RegExp( '\\[\\/?(?:' + window.mceViewL10n.shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' ); 497 // Escape tags inside shortcode previews. 498 body = body.replace( shortcodesRegExp, function( match ) { 499 return match.replace( /</g, '<' ).replace( />/g, '>' ); 500 } ); 501 } 496 502 497 503 this.getNodes( function( editor, node ) { -
branches/4.7/src/wp-includes/script-loader.php
r39697 r41436 939 939 'blog_id' => get_current_blog_id(), 940 940 ) ); 941 942 wp_localize_script( 'mce-view', 'mceViewL10n', array( 943 'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array() 944 ) ); 941 945 } 942 946
Note: See TracChangeset
for help on using the changeset viewer.