From eac47247875fe79960a1dfd714a8bb2f9a148e7d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 13 Feb 2026 16:38:16 +0800 Subject: Bump version to 0.1.2 and update docs for strip-ansi feature --- src/fmt_path.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fmt_path.rs b/src/fmt_path.rs index d7c5fd3..e2c06a4 100644 --- a/src/fmt_path.rs +++ b/src/fmt_path.rs @@ -40,7 +40,8 @@ impl Default for PathFormatConfig { /// Normalize an input path string into a canonical, platform‑agnostic form. /// -/// This function removes ANSI escape sequences, unifies separators to `/`, +/// This function removes ANSI escape sequences (requires `strip-ansi` feature), +/// unifies separators to `/`, /// collapses duplicate slashes, strips unfriendly characters (`*`, `?`, `"`, `<`, `>`, `|`), /// resolves simple `..` components, and preserves a trailing slash when present. /// @@ -80,7 +81,8 @@ pub fn fmt_path_str(path: impl Into) -> Result /// Normalize an input path string into a canonical, platform‑agnostic form. /// -/// This function removes ANSI escape sequences, unifies separators to `/`, +/// This function removes ANSI escape sequences (requires `strip-ansi` feature), +/// unifies separators to `/`, /// collapses duplicate slashes, strips unfriendly characters (`*`, `?`, `"`, `<`, `>`, `|`), /// resolves simple `..` components, and preserves a trailing slash when present. /// -- cgit From 2cef51d7448206291b1ac92fdaf708a7e30c78a4 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 24 Feb 2026 16:44:56 +0800 Subject: Fix detection of trailing backslash in path formatting --- src/fmt_path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_path.rs b/src/fmt_path.rs index e2c06a4..90a8d64 100644 --- a/src/fmt_path.rs +++ b/src/fmt_path.rs @@ -94,7 +94,7 @@ pub fn fmt_path_str_custom( config: &PathFormatConfig, ) -> Result { let path_result = path.into(); - let ends_with_slash = path_result.ends_with('/'); + let ends_with_slash = path_result.ends_with('/') || path_result.ends_with('\\'); // ANSI Strip #[cfg(feature = "strip-ansi")] -- cgit