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 1/2] 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, } From 8c63b372059fb576b79d90d1fcd3283aedc14f0b Mon Sep 17 00:00:00 2001 From: ump45nose Date: Thu, 15 Oct 2026 15:13:56 +0800 Subject: [PATCH 2/2] changelog: note StripAnsiMode rustdoc (#4067) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7e460ad..aaad217e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Other +- Document `StripAnsiMode` and its variants in rustdoc, see #4067 (@ump45nose) - Update Cargo dependencies to resolve current RustSec advisories, see #3861 (@TyceHerrman) - Add instructions for removing fish help abbreviations to README, see #3655 (@claw-explorer). Closes #3536 - Add .NET slnx extension, see #3682 (@ltrzesniewski)