summaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/link.rs10
1 files changed, 8 insertions, 2 deletions
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<String> {
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<String> {
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::<Func>().is_ok_and(|func| func.param(next).is_some()) {
+ route.push('-');
+ route.push_str(next);
+ }
+ }
} else if value
.clone()
.cast::<Func>()