From 20a35dc5e040abbcc4382d26b5a8c7eee4e82f67 Mon Sep 17 00:00:00 2001 From: "AsynchronousMatrix (Jack)" Date: Thu, 4 Jul 2024 22:34:45 +0100 Subject: [PATCH] feature(docs): fix broken links when embedded in promise/signal --- src/components/LuaProperty.astro | 11 ++++++++++- src/components/utils/lua.ts | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/LuaProperty.astro b/src/components/LuaProperty.astro index d349b07..dff8b42 100644 --- a/src/components/LuaProperty.astro +++ b/src/components/LuaProperty.astro @@ -8,10 +8,19 @@ type Props = { }; const { name, type } = Astro.props; + +var realType = type; + +if (type.includes("<")) { + const embeddedType = type.match(/<(.*?)>/); + + realType = embeddedType![1]; +} + ---
{name}  :: - +
\ No newline at end of file diff --git a/src/components/utils/lua.ts b/src/components/utils/lua.ts index c09d027..f4bb6c7 100644 --- a/src/components/utils/lua.ts +++ b/src/components/utils/lua.ts @@ -53,6 +53,7 @@ export const getCustomTypeDocs = (type: string) => { export const getTypeDocs = (type: string) => { const normalizedType = removeTypeModifiers(type); + return normalizedType in luaTypeDocs ? getLuaDocs(normalizedType) : getCustomTypeDocs(type);