Changeset 625


Ignore:
Timestamp:
05/24/09 23:54:19 (3 years ago)
Author:
jf.hovinne
Message:

Revert r623 and use a string replace instead. Should eventually fix #81.

Location:
trunk/src/wymeditor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wymeditor/jquery.wymeditor.explorer.js

    r624 r625  
    2626    this._newLine = "\r\n"; 
    2727 
    28     //r623 fix doesn't work in MSIE 
    29     wym._options.replaceBrInPreWith = false; 
    3028}; 
    3129 
  • trunk/src/wymeditor/jquery.wymeditor.js

    r623 r625  
    347347 
    348348    direction:  "ltr", 
    349  
    350     replaceBrInPreWith: '
', 
    351349 
    352350    boxHtml:   "<div class='wym_box'>" 
     
    910908 */ 
    911909WYMeditor.editor.prototype.xhtml = function() { 
    912     if(this._options.replaceBrInPreWith) 
    913       jQuery('pre > br', this._doc.body).replaceWith(this._options.replaceBrInPreWith); //Fix PRE bug #81 
    914910    return this.parser.parse(this.html()); 
    915911}; 
     
    34223418  xhtml = this.joinRepeatedEntities(xhtml); 
    34233419  xhtml = this.removeEmptyTags(xhtml); 
     3420  xhtml = this.removeBrInPre(xhtml); 
    34243421  return xhtml; 
    34253422}; 
     
    34433440{ 
    34443441  return xhtml.replace(new RegExp('<('+this.block_tags.join("|").replace(/\|td/,'').replace(/\|th/, '')+')>(<br \/>|&#160;|&nbsp;|\\s)*<\/\\1>' ,'g'),''); 
     3442}; 
     3443 
     3444WYMeditor.XhtmlSaxListener.prototype.removeBrInPre = function(xhtml) 
     3445{ 
     3446  var matches = xhtml.match(new RegExp('<pre[^>]*>(.*?)<\/pre>','gmi')); 
     3447  for(var i=0; i<matches.length; i++) { 
     3448    xhtml = xhtml.replace(matches[i], matches[i].replace(new RegExp('<br \/>', 'g'), String.fromCharCode(13,10))); 
     3449  } 
     3450  return xhtml; 
    34453451}; 
    34463452 
Note: See TracChangeset for help on using the changeset viewer.