-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
The implementation of AnsiColor is quite hacky. It needs to replace the entire body of text with html (translates ansi codes that can appear anywhere inside the text to html). Unfortunately MarkupText only lets you markup the text by inserting tags in different locations, which is not practical at all since we need to delete existing text and insert tags all over the place.
I'd like to see MarkupText refactored to allow complete replacement of the data with unencoded html. For starters, maybe a clearText() could get the job done? Generally, markuptext is trying to be too smart about markup.
Another option could be an extension point that lets me replace the text stream with html (unencoded).
Refactor core/src/main/java/hudson/MarkupText.java
https://github.com/dblock/jenkins-ansicolor-plugin
Ansicolor 0.4.0 uses a different stream approach, so this is no longer needed for that. It's still a good idea IMO.