We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7df1596 commit 2bca624Copy full SHA for 2bca624
src/utils/mod.rs
@@ -219,8 +219,16 @@ fn adjust_links<'a>(
219
.to_str()
220
.expect("utf-8 paths only")
221
.to_owned();
222
- write!(unnormalized_path, "{}/{}", normalize_path(base), redirect)
223
- .unwrap();
+
+ let normalized_base =
224
+ normalize_path(base).trim_matches('/').to_owned();
225
+ if !normalized_base.is_empty() {
226
+ write!(unnormalized_path, "{}/{}", normalized_base, redirect)
227
+ .unwrap();
228
+ } else {
229
+ unnormalized_path =
230
+ redirect.to_string().trim_start_matches('/').to_string();
231
+ }
232
}
233
234
// original without anchors, need to append link anchors
0 commit comments