//! 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('"')
        .and_then(|s| s.strip_suffix('"'))
        .unwrap_or(&s)
        .to_string()
}
