Changeset 265 for trunk


Ignore:
Timestamp:
07/17/05 02:26:39 (14 years ago)
Author:
gogo
Message:

Add config option to produce seven bit clean HTML output (higher
characters are replaced with entities).

See ticket:284

Off by default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htmlarea.js

    r263 r265  
    250250  //  only ! through ~) are escaped in URLs to % codes 
    251251  this.only7BitPrintablesInURLs = true; 
     252 
     253  // if you are putting the HTML written in Xinha into an email you might want it to be 7-bit 
     254  //  characters only.  This config option (off by default) will convert all characters consuming 
     255  //  more than 7bits into UNICODE decimal entity references (actually it will convert anything 
     256  //  below <space> (chr 20) except cr, lf and tab and above <tilde> (~, chr 7E)) 
     257  this.sevenBitClean  = false; 
    252258 
    253259  // sometimes we want to be able to replace some string in the html comng in and going out 
     
    41164122 
    41174123  html = this.fixRelativeLinks(html); 
     4124 
     4125  if(this.config.sevenBitClean) 
     4126  { 
     4127    html = html.replace(/[^ -~\r\n\t]/g, function(c){ return '&#'+c.charCodeAt(0)+';';}); 
     4128  } 
     4129 
    41184130  return html; 
    41194131} 
Note: See TracChangeset for help on using the changeset viewer.