You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ANSI Escapes Converted to HTML Properties in Report #5774
Would there be any interest in adding a built-in mechanism to automatically translate ANSI color codes into HTML/CSS styling in report files? (for example, via a new ansi=True argument to logger)?
Currently, capturing CLI outputs (like Ansible or Docker) clutters reports with raw escape codes unless they are stripped or parsed externally. I'm happy to implement this via a pull request, but wanted to check if this fits within the project's scope before writing the code.
Sounds useful! You idea is to add this argument to robot.api.logger functions like info, right? Probably then should add it also to BuiltIn.Log.
I know there are external modules that could be used, but we don't want to have mandatory dependencies to make installation also without an Internet connection easy. Handling just color codes and possibly links in our own code base ought to be pretty easy, but we could implement this so that if a certain external module is installed, it is used instead.
Yes, Implementation in robot.api.logger and Builtin.Log as you suggested.
I would approach this with simple regex parser that would convert "Select Graphic Rendition" (SGR) settings to HTML.
The escape codes that would have to be converted are listed here: CSI Pm m Character Attributes (SGR): https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
There are only few of them so the implementation should be lean.
Terminal hyper links could also be supported. There's only an informal spec, but they seem to be pretty widely supported and used. We added support for them in RF 7.1 (#5189).
Activity
pekkaklarck commentedon Sep 1, 2026
Sounds useful! You idea is to add this argument to
robot.api.loggerfunctions likeinfo, right? Probably then should add it also toBuiltIn.Log.I know there are external modules that could be used, but we don't want to have mandatory dependencies to make installation also without an Internet connection easy. Handling just color codes and possibly links in our own code base ought to be pretty easy, but we could implement this so that if a certain external module is installed, it is used instead.
yan3ku commentedon Sep 1, 2026
Yes, Implementation in
robot.api.loggerandBuiltin.Logas you suggested.I would approach this with simple regex parser that would convert "Select Graphic Rendition" (SGR) settings to HTML.
The escape codes that would have to be converted are listed here:
CSI Pm m Character Attributes (SGR): https://invisible-island.net/xterm/ctlseqs/ctlseqs.htmlThere are only few of them so the implementation should be lean.
pekkaklarck commentedon Sep 3, 2026
Sounds good to me!
Terminal hyper links could also be supported. There's only an informal spec, but they seem to be pretty widely supported and used. We added support for them in RF 7.1 (#5189).