dotnet / dotnet/docfx

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

Open
#10,125 0 comments 0 reactions 0 assignees View on GitHub
dotnet
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

Given:

```csharp
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.