Ticket #31158: 31158.patch
| File 31158.patch, 1.2 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 node; 171 172 172 if ( ! event.content) {173 if ( ! pastedStr ) { 173 174 return; 174 175 } 175 176 … … 179 180 180 181 node = editor.selection.getNode(); 181 182 183 pastedStr = pastedStr.replace( /<[^>]+>/g, '' ); 184 pastedStr = tinymce.trim( pastedStr ); 185 182 186 // 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; 187 if ( /^https?:\/\/\S+$/i.test( pastedStr ) ) { 188 event.content = pastedStr; 189 190 if ( node.nodeName !== 'P' || node.parentNode !== editor.getBody() || ! editor.dom.isEmpty( node ) ) { 191 return; 192 } 186 193 } 187 194 188 195 event.content = wp.mce.views.setMarkers( event.content );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)