~canonical-sysadmins/wordpress/4.9.7

« back to all changes in this revision

Viewing changes to wp-includes/js/mce-view.js

  • Committer: Barry Price
  • Date: 2017-09-20 02:34:45 UTC
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: barry.price@canonical.com-20170920023445-2ylln1i0tkpo301s
new upstream release 4.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
                                encodedText,
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
162
160
                                // or autop will replace them with <p> and <br> later and the string won't match.
431
429
                                var selected = node === editor.selection.getNode();
432
430
                                var $viewNode;
433
431
 
434
 
                                if ( ! this.loader && $( node ).text() !== this.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;
437
435
                                }
502
500
                setIframes: function( head, body, callback, rendered ) {
503
501
                        var self = this;
504
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, '&lt;' ).replace( />/g, '&gt;' );
 
508
                                } );
 
509
                        }
 
510
 
505
511
                        this.getNodes( function( editor, node ) {
506
512
                                var dom = editor.dom,
507
513
                                        styles = '',