diff options
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/path_display.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util/path_display.rs b/src/util/path_display.rs index d7bd624..78ff989 100644 --- a/src/util/path_display.rs +++ b/src/util/path_display.rs @@ -1,12 +1,15 @@ -//! Path display helpers. +//! Helpers for displaying filesystem paths in generated Markdown. use std::path::Path; /// Converts a path to a Markdown-friendly display string. /// -/// This uses Rust's debug path formatting, then strips surrounding quotes when present. That keeps -/// escaped characters such as newlines and invalid UTF-8 markers visible in generated Markdown -/// headings. +/// The returned string uses Rust's debug-style path formatting so that unusual characters remain +/// visible instead of affecting the Markdown structure. For example, embedded newlines are shown as +/// `\n`, and invalid UTF-8 bytes are escaped. +/// +/// Surrounding quotes added by debug formatting are stripped when present, so ordinary paths remain +/// easy to read. pub fn display_path(path: &Path) -> String { let s = format!("{:?}", path); s.strip_prefix('"') |
