Ticket #2272: 2272_2.patch
File 2272_2.patch, 3.7 KB (added by , 16 years ago) |
---|
-
_whatsnew.html
67 67 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2322">#2322</a>] Fixed the issue 68 68 where the fit window command loses the current selection and scroll position in the 69 69 editing area.</li> 70 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2272">#2272</a>] Improved the 71 garbage filter in Paste from Word dialog.</li> 70 72 </ul> 71 73 <p> 72 74 <a href="_whatsnew_history.html">See previous versions history</a></p> -
editor/dialog/fck_paste.html
187 187 var html = oNode.innerHTML ; 188 188 189 189 html = html.replace(/<o:p>\s*<\/o:p>/g, '') ; 190 html = html.replace(/<o:p> .*?<\/o:p>/g, ' ') ;190 html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, ' ') ; 191 191 192 192 // Remove mso-xxx styles. 193 193 html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ; … … 224 224 if ( bRemoveStyles ) 225 225 html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ; 226 226 227 // Remove style, meta and link tags 228 html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ; 229 html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ; 230 227 231 // Remove empty styles. 228 232 html = html.replace( /\s*style="\s*"/gi, '' ) ; 229 233 … … 234 238 // Remove Lang attributes 235 239 html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; 236 240 237 html = html.replace( /<SPAN\s*>( .*?)<\/SPAN>/gi, '$1' ) ;241 html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ; 238 242 239 html = html.replace( /<FONT\s*>( .*?)<\/FONT>/gi, '$1' ) ;243 html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ; 240 244 241 245 // Remove XML elements and declarations 242 246 html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ; 243 247 248 // Remove w: tags with contents. 249 html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ; 250 244 251 // Remove Tags with XML namespace declarations: <o:p><\/o:p> 245 252 html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ; 246 253 247 254 // Remove comments [SF BUG-1481861]. 248 html = html.replace(/<\!-- .*?-->/g, '' ) ;255 html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ; 249 256 250 257 html = html.replace( /<(U|I|STRIKE)> <\/\1>/g, ' ' ) ; 251 258 252 259 html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ; 253 260 254 261 // Remove "display:none" tags. 255 html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none (.*?)<\/\1>/ig, '' ) ;262 html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ; 256 263 257 264 // Remove language tags 258 265 html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ; … … 267 274 html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ; 268 275 269 276 // Word likes to insert extra <font> tags, when using MSIE. (Wierd). 270 html = html.replace( /<(H\d)><FONT[^>]*>( .*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );271 html = html.replace( /<(H\d)><EM>( .*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );277 html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' ); 278 html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' ); 272 279 } 273 280 else 274 281 { … … 282 289 html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ; 283 290 284 291 // Transform <P> to <DIV> 285 var re = new RegExp( '(<P)([^>]*> .*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error292 var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error 286 293 html = html.replace( re, '<div$2<\/div>' ) ; 287 294 288 295 // Remove empty tags (three times, just to be sure).