Fix bad links in docs code blocks (#6649)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -577,12 +577,16 @@ fn cleanup_type_string(input: &str, fmt_for_text: bool) -> String {
|
||||
ty
|
||||
};
|
||||
|
||||
if SPECIAL_TYPES.contains(&ty) {
|
||||
// TODO markdown links in code blocks are not turned into links by our website stack.
|
||||
// If we can handle signatures more manually we could get highlighting and links and
|
||||
// we might want to restore the links by not checking `fmt_for_text` here.
|
||||
|
||||
if fmt_for_text && SPECIAL_TYPES.contains(&ty) {
|
||||
format!("[{prefix}{ty}{suffix}](/docs/kcl/types#{ty})")
|
||||
} else if DECLARED_TYPES.contains(&ty) {
|
||||
} else if fmt_for_text && DECLARED_TYPES.contains(&ty) {
|
||||
format!("[{prefix}{ty}{suffix}](/docs/kcl/types/std-types-{ty})")
|
||||
} else {
|
||||
format!("{prefix}{input}{suffix}")
|
||||
format!("{prefix}{ty}{suffix}")
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
Reference in New Issue
Block a user