Skip to content

Commit

Permalink
path shortening when namespace begins with assembly name
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed Jul 1, 2024
1 parent b2e7248 commit 539c578
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Doki.Output.Markdown/InternalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,14 @@ private static List<string> GetPathList(DocumentationObject documentationObject)
// We cannot use TryGetParent because it will return the wrong namespace/assembly for base type references coming from a different namespace/assembly.
if (typeDocumentationReference.Assembly != null) pathList.Add(typeDocumentationReference.Assembly);

if (typeDocumentationReference.Namespace != null) pathList.Add(typeDocumentationReference.Namespace);
if (typeDocumentationReference.Namespace != null)
{
if (typeDocumentationReference.Assembly != null &&
typeDocumentationReference.Namespace.StartsWith(typeDocumentationReference.Assembly))
pathList.Add(
typeDocumentationReference.Namespace[(typeDocumentationReference.Assembly.Length + 1)..]);
else pathList.Add(typeDocumentationReference.Namespace);
}

pathList.Add(typeDocumentationReference.GetPathId());

Expand Down

0 comments on commit 539c578

Please sign in to comment.