google / google/googletest

[Bug]: Internal section links in docs (markdown) do not work

Open
#4,099 1 comment 0 reactions 1 assignee Claimed by @derekmauro View on GitHub
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

### Describe the issue

The internal section links (by heading ID) are not working (at least not in GitHub's markdown renderer).

Example:
https://github.com/google/googletest/blob/5ab508a01f9eb089207ee87fd547d290da39d015/docs/reference/assertions.md?plain=1#L159-L160
contains the link for this section:
https://github.com/google/googletest/blob/5ab508a01f9eb089207ee87fd547d290da39d015/docs/reference/assertions.md?plain=1#L261
```
https://github.com/google/googletest/blob/main/docs/reference/assertions.md#floating-point
```
but GitHub does not take you to the "Floating Point" section. Instead this would be the correct link:
```
https://github.com/google/googletest/blob/main/docs/reference/assertions.md#floating-point-comparison-floating-point
```

It seems that by trying to place the shorthand heading ID `(#floating-point)` in the heading text itself, it has caused GitHub's .md renderer to not recognize `floating-point` as the correct heading ID.

There are many headings and links that have this same issue in this file, and this may affect other files too, if they follow the same heading format.

### Steps to reproduce the problem

1. Navigate to this page (linked in the binary comparison section of the Assertions reference doc).
```
https://github.com/google/googletest/blob/main/docs/reference/assertions.md#floating-point
```
or click here: https://github.com/google/googletest/blob/main/docs/reference/assertions.md#floating-point
2. Observe that the floating point section is not opened.
3. Navigate to this page (proposed link correction).
```
https://github.com/google/googletest/blob/main/docs/reference/assertions.md#floating-point-comparison-floating-point
```
or click here: https://github.com/google/googletest/blob/main/docs/reference/assertions.md#floating-point-comparison-floating-point
4. Observe that the floating point section is *now* opened.

### What version of GoogleTest are you using?

N/A

### What operating system and version are you using?

N/A

### What compiler and version are you using?

N/A

### What build system are you using?

N/A

### Additional context

_No response_

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.