summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-06-04 13:39:01 +0300
committerA Farzat <a@farzat.xyz>2026-06-04 13:39:01 +0300
commit54cc2bf0701e4b6f04a7345ca6d4d761fa76949b (patch)
treeeb024c14b6c84ccaaa5e2fd08f35d1bf7f5d438c /src/main.rs
parent6d7a879bdf848f8c40dd39ed8cfb0c48012d17f1 (diff)
downloadrepo2markdown-54cc2bf0701e4b6f04a7345ca6d4d761fa76949b.tar.gz
repo2markdown-54cc2bf0701e4b6f04a7345ca6d4d761fa76949b.zip
Escape non-standard paths in the markdown file
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 049ba55..6cd13e2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -34,9 +34,9 @@ pub fn run<R: Read, W: Write>(
}
// convert to expected renderer input
- let refs: Vec<(&str, &[u8])> = owned
+ let refs: Vec<(&Path, &[u8])> = owned
.iter()
- .map(|(p, b)| (p.to_str().unwrap(), b.as_slice()))
+ .map(|(p, b)| (p.as_path(), b.as_slice()))
.collect();
let rendered = render("Project name", &refs)?;
@@ -74,7 +74,7 @@ mod tests {
let output_str = String::from_utf8(output).unwrap();
- assert!(output_str.contains("### test_main.rs"));
+ assert!(output_str.contains("### \"test_main.rs\""));
assert!(output_str.contains("fn main() {}"));
// cleanup
@@ -114,7 +114,7 @@ mod tests {
let output = String::from_utf8(output).unwrap();
- assert!(output.contains("### test/main.rs"));
+ assert!(output.contains("### \"test/main.rs\""));
fs::remove_file("test/main.rs").unwrap();
fs::remove_dir("test").unwrap();