1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-04 19:01:44 +00:00

improve patch

This commit is contained in:
curious-rabbit
2026-07-01 07:54:51 +02:00
parent d72163160e
commit 0a52e4321f
2 changed files with 5 additions and 10 deletions
+2 -5
View File
@@ -194,13 +194,10 @@ impl<'a> PrettyPrinter<'a> {
/// Whether to sanitize untrusted input for safe display (default: never)
///
/// Implies [`strip_ansi`](Self::strip_ansi) at the same value, and also
/// replaces terminal-active and bidi / zero-width bytes with U+FFFD.
/// Strips ANSI escape sequences and additionally substitutes terminal-active
/// control bytes and bidi / zero-width codepoints with U+FFFD.
pub fn sanitize(&mut self, mode: StripAnsiMode) -> &mut Self {
self.config.sanitize = mode;
if mode != StripAnsiMode::Never {
self.config.strip_ansi = mode;
}
self
}