Changeset 31856
- Timestamp:
- 03/20/2015 08:33:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r31832 r31856 174 174 } 175 175 176 node = editor.selection.getNode(); 177 178 // When a url is pasted, only try to embed it when pasted in an empty paragrapgh. 179 if ( event.content.match( /^\s*(https?:\/\/[^\s"]+)\s*$/i ) && 180 ( node.nodeName !== 'P' || node.parentNode !== editor.getBody() || ! editor.dom.isEmpty( node ) ) ) { 181 182 return; 176 if ( ! event.load ) { 177 node = editor.selection.getNode(); 178 179 if ( node && node !== editor.getBody() && /^\s*https?:\/\/\S+\s*$/i.test( event.content ) ) { 180 // When a url is pasted or inserted, only try to embed it when it is in an empty paragrapgh. 181 node = editor.dom.getParent( node, 'p' ); 182 183 if ( node && /^[\s\uFEFF\u00A0]*$/.test( node.textContent || node.innerText ) ) { 184 // Make sure there are no empty inline elements in the <p> 185 node.innerHTML = ''; 186 } else { 187 return; 188 } 189 } 183 190 } 184 191
Note: See TracChangeset
for help on using the changeset viewer.