Ticket #31158: 31158.2.patch
| File 31158.2.patch, 1.4 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/js/tinymce/plugins/wpview/plugin.js
167 167 // matching view patterns, and transform the matches into 168 168 // view wrappers. 169 169 editor.on( 'BeforeSetContent', function( event ) { 170 var node; 170 var pastedStr = event.content, 171 trim = tinymce.trim, 172 node; 171 173 172 if ( ! event.content) {174 if ( ! pastedStr ) { 173 175 return; 174 176 } 175 177 … … 179 181 180 182 node = editor.selection.getNode(); 181 183 184 pastedStr = pastedStr.replace( /<[^>]+>/g, '' ); 185 pastedStr = trim( pastedStr ); 186 182 187 // When a url is pasted, only try to embed it when pasted in an empty paragrapgh. 183 if ( event.content.match( /^\s*(https?:\/\/[^\s"]+)\s*$/i ) && 184 ( node.nodeName !== 'P' || node.parentNode !== editor.getBody() || ! editor.dom.isEmpty( node ) ) ) { 185 return; 188 if ( /^https?:\/\/\S+$/i.test( pastedStr ) ) { 189 event.content = pastedStr; 190 191 node = editor.dom.getParent( node, function( node ) { 192 if ( node.parentNode === editor.getBody() ) { 193 return node; 194 } 195 } ); 196 197 if ( node.nodeName !== 'P' || trim( node.textContent ) || trim( node.innerText ) ) { 198 return; 199 } 186 200 } 187 201 188 202 event.content = wp.mce.views.setMarkers( event.content );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)