SetContentSanitization toggles ANSI escape sanitization on ContentOut. Commands should call this with false when an explicit opt-out flag (e.g. --allow-escape-sequences) is set, so subsequent writes of external content pass through unmodified.
(enabled bool)
| 492 | // --allow-escape-sequences) is set, so subsequent writes of external content |
| 493 | // pass through unmodified. |
| 494 | func (s *IOStreams) SetContentSanitization(enabled bool) { |
| 495 | s.sanitizeContent = enabled |
| 496 | s.ContentOut = newContentWriter(s.Out, enabled) |
| 497 | } |
| 498 | |
| 499 | // newContentWriter returns the writer to wire up as ContentOut. When |
| 500 | // sanitize is true it inserts an asciisanitizer in front of the underlying |
no test coverage detected