From d50b53d0ef093f363a4b41e445ec240e57aee943 Mon Sep 17 00:00:00 2001 From: yuwk <1729065730@qq.com> Date: Thu, 15 Oct 2026 09:37:35 +0800 Subject: [PATCH] Document StripAnsiMode and its variants with doc comments --- src/preprocessor.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/preprocessor.rs b/src/preprocessor.rs index a9b8e712..c19d0092 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -302,11 +302,21 @@ pub fn strip_overstrike(line: &str, first_backspace: usize) -> String { output } +/// Specify when to strip ANSI escape sequences from the input. +/// +/// Used for both the `--strip-ansi` and the `--sanitize` option, the latter +/// implying the former with the same value. #[derive(Debug, PartialEq, Clone, Copy, Default)] pub enum StripAnsiMode { + /// Keep escape sequences in the output #[default] Never, + + /// Strip escape sequences from the output Always, + + /// Strip escape sequences unless the syntax highlighting language is plain + /// text, in which case they may be part of what the input wants to display Auto, }