ansifilter

Strip or convert ANSI color codes to HTML, LaTeX, RTF, or BBCode

brewmacoslinux
Try with needOr install directly
Source

About

Strip or convert ANSI codes into HTML, (La)Tex, RTF, or BBCode

Commands

ansifilter

Examples

Strip ANSI codes from colored output and save as plain text$ ansifilter < colored_output.txt > plain_output.txt
Convert ANSI codes to HTML format$ ansifilter --html < input.txt > output.html
Strip ANSI codes from piped command output$ ls --color=always | ansifilter