Ticket #131: wymeditor-paste-fix.patch

File wymeditor-paste-fix.patch, 0.8 kB (added by c_t, 22 months ago)

Don't leave empty lines when using "Paste from Word"

  • js/wymeditor/jquery.wymeditor.js

     
    12011201        sTmp = sTmp.replace(rExp, "<br />"); 
    12021202        jQuery(container).after("<p>" + sTmp + "</p>"); 
    12031203    } 
     1204        // remove empty container where stuff was pasted in. 
     1205        if (jQuery(container).html() == "<" + WYMeditor.BR + ">") { 
     1206                jQuery(container).remove(); 
     1207        } 
    12041208  } else { 
     1209        //empty area, if someone just clicked in it 
     1210        if (jQuery(this._doc.body).html() == "<" + WYMeditor.BR + ">") { 
     1211                jQuery(this._doc.body).html(''); 
     1212        } 
    12051213    for(x = 0; x < aP.length; x++) { 
    12061214        sTmp = aP[x]; 
    12071215        //simple newlines are replaced by a break