Ticket #31412: 31412.21.patch
File 31412.21.patch, 1.1 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/mce-view.js
33 33 wp.mce = wp.mce || {}; 34 34 35 35 /** 36 * Decode HTML entities in a givin string. 37 * 38 * @param {String} html The string to decode. 39 */ 40 function decodeHTML( html ) { 41 var textarea = document.createElement( 'textarea' ); 42 43 textarea.innerHTML = html; 44 45 return textarea.value; 46 } 47 48 /** 36 49 * wp.mce.views 37 50 * 38 51 * A set of utilities that simplifies adding custom UI within a TinyMCE editor. … … 89 102 * @param {String} content The string to scan. 90 103 */ 91 104 setMarkers: function( content ) { 92 var pieces = [ { content: content} ],105 var pieces = [ { content: decodeHTML( content ) } ], 93 106 self = this, 94 107 current; 95 108 … … 390 403 */ 391 404 replaceMarkers: function() { 392 405 this.getMarkers( function( editor, node ) { 393 if ( $( node ). html() !== this.text ) {406 if ( $( node ).text() !== this.text ) { 394 407 editor.dom.setAttrib( node, 'data-wpview-marker', null ); 395 408 return; 396 409 }