#2728: String.prototype.Trim should also trim unicode two-byte whitespace
------------------------+---------------------------------------------------
 Reporter:  thiloplanz  |       Owner:     
     Type:  Bug         |      Status:  new
 Priority:  Normal      |   Milestone:     
Component:  General     |     Version:     
 Keywords:              |  
------------------------+---------------------------------------------------
 String.prototype.Trim (defined in fckjscoreextensions.js) should also
 remove the Unicode "Ideographic Space" (U+3000), which is used in
 Japanese.

 {{{
 #!js
 String.prototype.Trim = function()
 {
         // We are not using \s because we don't want "non-breaking spaces
 to be caught".
         return this.replace( /(^[ \t\n\r\u3000]*)|([ \t\n\r\u3000]*$)/g,
 '' ) ;
 }

 String.prototype.LTrim = function()
 {
         // We are not using \s because we don't want "non-breaking spaces
 to be caught".
         return this.replace( /^[ \t\n\r\u3000]*/g, '' ) ;
 }

 String.prototype.RTrim = function()
 {
         // We are not using \s because we don't want "non-breaking spaces
 to be caught".
         return this.replace( /[ \t\n\r\u3000]*$/g, '' ) ;
 }
 }}}

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/2728>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to