Skip to content

Commit

Permalink
[doc] Invalid links #417
Browse files Browse the repository at this point in the history
  • Loading branch information
Harvey1214 committed Nov 8, 2023
1 parent e097f5f commit da0af6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 7 additions & 1 deletion Havit.Blazor.Documentation/Model/MemberModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ private string GenerateFullLink(string[] splitLink, string fullLink)

private string HandleSupportClasses(string[] splitLink, string fullLink)
{
if (IsProperty(splitLink))
{
return null;
}

if (IsEnum(splitLink))
{
string internalTypeLink = ApiRenderer.GenerateLinkForInternalType(splitLink[^2], false, $"{splitLink[^2]}.{splitLink[^1]}");
Expand Down Expand Up @@ -165,7 +170,8 @@ private string GenerateHavitDocumentationLink(string[] splitLink)
}
}

isComponent = ApiTypeHelper.GetType(splitLink[^2])?.IsSubclassOf(typeof(ComponentBase)) ?? false;
var type = enclosingType ?? ApiTypeHelper.GetType(splitLink[^2]);
isComponent = type?.IsSubclassOf(typeof(ComponentBase)) ?? false;
}
else
{
Expand Down
10 changes: 0 additions & 10 deletions Havit.Blazor.Documentation/Services/ApiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ public static Type GetType(string typeName)
}
catch { }

try
{
result = typeof(HxButton).Assembly.GetTypes().FirstOrDefault((t) => t.FullName.Contains(typeName));
if (result is not null)
{
return result;
}
}
catch { }

return null;
}
}

0 comments on commit da0af6f

Please sign in to comment.