From a2d097686f01b2834f4a9b313bd9c1c692210479 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 9 Mar 2024 17:56:56 +0100 Subject: Update changelog and roadmap (#3594) --- docs/src/link.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'docs/src') diff --git a/docs/src/link.rs b/docs/src/link.rs index 537dee77..2f3582c7 100644 --- a/docs/src/link.rs +++ b/docs/src/link.rs @@ -20,7 +20,7 @@ pub fn resolve(link: &str, base: &str) -> StrResult { route.push_str(tail); } - if !route.contains('#') && !route.ends_with('/') { + if !route.contains(['#', '?']) && !route.ends_with('/') { route.push('/'); } @@ -89,9 +89,15 @@ fn resolve_definition(head: &str, base: &str) -> StrResult { let mut route = format!("{}reference/{}/{name}/", base, category.name()); if let Some(next) = parts.next() { - if value.field(next).is_ok() { + if let Ok(field) = value.field(next) { route.push_str("#definitions-"); route.push_str(next); + if let Some(next) = parts.next() { + if field.cast::().is_ok_and(|func| func.param(next).is_some()) { + route.push('-'); + route.push_str(next); + } + } } else if value .clone() .cast::() -- cgit v1.2.3