dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.03k stars 858 forks source link

[Bug] Broken hrefs with `SeparatePages` when member names collide #10125

Open frarees opened 2 months ago

frarees commented 2 months ago

Given:

namespace MyNamespace
{
    public enum MyOutterEnum
    {
    }

    public class MyClass
    {
        public enum MyEnum
        {
        }

        public enum MyEnum2
        {
        }

        public MyEnum myEnum;
        public MyEnum myOtherEnum;
        public MyEnum2 myEnumTwo;
        public MyOutterEnum myOutterEnum;
    }
}

Build the metadata using "memberLayout": "separatePages".

Notice that the generation includes:

MyNamespace.MyClass.MyEnum(Enum).html
MyNamespace.MyClass.MyEnum(Field).html

But on the pages for myEnum and myOtherEnum, the href to the return value points to:

MyNamespace.MyClass.MyEnum.html

Leading to a missing page.

Reproduced on 2.77.0.