From 63a2f778b194ced2dd95d373c18e8a9114f3c25b Mon Sep 17 00:00:00 2001 From: Mc-Zen Date: Sun, 15 Dec 2024 18:42:23 +0100 Subject: [PATCH] [improve] reference handling, fixes #39 Doc-comments can now contain references which are not treated as cross-references, e.g., references to other parts of the document. --- src/show-module.typ | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/show-module.typ b/src/show-module.typ index 98499af..4559c40 100644 --- a/src/show-module.typ +++ b/src/show-module.typ @@ -139,7 +139,14 @@ return raw(target) } let defs = def-state.final() - if defs.at(target, default: none) == 1 { + + let base = target + if "." in base { base = base.split(".").first() } + let target-def = defs.at(target, default: none) + let base-def = defs.at(base, default: none) + if target-def == none and base-def == none { return it } + + if target-def == 1 { target += "()" } (eval-scope.tidy.show-reference)(label(label-prefix + target), target)