Changeset 31612
- Timestamp:
- 03/04/2015 08:34:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r31586 r31612 29 29 30 30 var views = {}, 31 instances = {}; 31 instances = {}, 32 textarea = document.createElement( 'textarea' ); 32 33 33 34 wp.mce = wp.mce || {}; 35 36 /** 37 * Decode HTML entities in a givin string. 38 * 39 * @param {String} html The string to decode. 40 */ 41 function decodeHTML( html ) { 42 textarea.innerHTML = html; 43 html = textarea.value; 44 45 textarea.innerHTML = textarea.value = ''; 46 47 return html; 48 } 34 49 35 50 /** … … 90 105 */ 91 106 setMarkers: function( content ) { 92 var pieces = [ { content: content} ],107 var pieces = [ { content: decodeHTML( content ) } ], 93 108 self = this, 94 109 current; … … 391 406 replaceMarkers: function() { 392 407 this.getMarkers( function( editor, node ) { 393 if ( $( node ). html() !== this.text ) {408 if ( $( node ).text() !== this.text ) { 394 409 editor.dom.setAttrib( node, 'data-wpview-marker', null ); 395 410 return;
Note: See TracChangeset
for help on using the changeset viewer.