Package Info

perl-Parse-ANSIColor-Tiny


Determine attributes of ANSI-Colored string


Unspecified

Parse a string colored with ANSI escape sequences into a structure suitable for reformatting (into HTML, for example).

The output of terminal commands can be marked up with colors and formatting that in some instances you'd like to preserve.

This module is essentially the inverse of Term::ANSIColor. The array refs returned from parse can be passed back in to 'Term::ANSIColor::colored'. The strings may not match exactly due to different ways the attributes can be specified, but the end result should be colored the same.

This is a '::Tiny' module... it attempts to be correct for most cases with a small amount of code. It may not be 100% correct, especially in complex cases. It only handles the 'm' escape sequence ('\033[0m') which produces colors and simple attributes (bold, underline) (like what can be produced with Term::ANSIColor). Other escape sequences are removed by default but you can disable this by passing 'remove_escapes => 0' to the constructor.

If you do find bugs please submit tickets (with patches, if possible).


License: Artistic-1.0 OR GPL-1.0-or-later
URL: https://metacpan.org/release/Parse-ANSIColor-Tiny

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.700-bp156.2.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Parse-ANSIColor-Tiny
0.700-bp155.1.5 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Parse-ANSIColor-Tiny