diff options
| author | A Farzat <a@farzat.xyz> | 2026-06-20 13:53:38 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-06-20 13:53:38 +0300 |
| commit | 0b679b0b5d81ad8c5f61031ffe56b3f646ba9234 (patch) | |
| tree | 6cec5103bdc794f90a6ad448c5e4789f8f43f9d5 /src/util/path_display.rs | |
| parent | fc1b96579c24ca062d6a569139006fe475710ea6 (diff) | |
| download | repo2markdown-0b679b0b5d81ad8c5f61031ffe56b3f646ba9234.tar.gz repo2markdown-0b679b0b5d81ad8c5f61031ffe56b3f646ba9234.zip | |
Add module/function docs to path_display
Diffstat (limited to 'src/util/path_display.rs')
| -rw-r--r-- | src/util/path_display.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/path_display.rs b/src/util/path_display.rs index e9dca4b..d7bd624 100644 --- a/src/util/path_display.rs +++ b/src/util/path_display.rs @@ -1,5 +1,12 @@ +//! Path display helpers. + 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. pub fn display_path(path: &Path) -> String { let s = format!("{:?}", path); s.strip_prefix('"') |
