]> jfr.im git - irc/xchat.git/commitdiff
Add ANSI escape code striping to strip_code
authorlsitu <redacted>
Wed, 2 Dec 2009 08:51:18 +0000 (08:51 +0000)
committerlsitu <redacted>
Wed, 2 Dec 2009 08:51:18 +0000 (08:51 +0000)
git-svn-id: svn://svn.code.sf.net/p/xchat/svn@1383 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1

ChangeLog
plugins/perl/Xchat.pm
plugins/perl/Xchat.pod

index d5c340df82d084086a114e029cf9e6a2ff211119..5a7ec3651c08228cea5ba63f841adb1dc81020e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,7 @@ highlights. The full CVS log is available at www.xchat.org/cvslog/
   * /reloadall will now reload scripts in the same order they were loaded
   * Make xchat_send_modes available as Xchat::send_modes
   * Add support for getting the network list using Xchat::get_list( "networks" )
+  * Xchat::strip_code will now strip off ANSI escape codes as well
 
 ------------------------------------------------------------------------------
  2.8.6 - 11/Jun/2008
index 902b50e6b655cfd9c8282e01fb21062f40691cda..798c92cc05bdaaba7359e0e5df64eb94de368823 100644 (file)
@@ -455,6 +455,7 @@ sub strip_code {
        my $pattern = qr[
                \cB| #Bold
                \cC\d{0,2}(?:,\d{1,2})?| #Color
+               \e\[\d{1,2}(?:;\d{1,2})m| # ANSI escape codes
                \cG| #Beep
                \cO| #Reset
                \cV| #Reverse
index 243faae041d5a14ed3bd6a091adc8244444d32b1..bf58eae97ef20a872265e7b8c57cfe744d213520 100644 (file)
@@ -1197,7 +1197,7 @@ C<$string>  -  string to remove codes from
 
 =back
 
-This function will remove bold, color, beep, reset, reverse and underline codes from C<$string>. If it is called in void context C<$string> will be modified otherwise a modified copy of C<$string> is returned.
+This function will remove bold, color, beep, reset, reverse and underline codes from C<$string>. It will also remove ANSI escape codes which might get used by certain terminal based clients. If it is called in void context C<$string> will be modified otherwise a modified copy of C<$string> is returned.
 
 =head2 Contact Information