googletest icon indicating copy to clipboard operation
googletest copied to clipboard

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

Open kkaja123 opened this issue 2 years ago • 1 comments

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

kkaja123 avatar Dec 21 '22 20:12 kkaja123

See https://github.com/google/googletest/blob/main/README.md#documentation-updates

Our documentation is now live on GitHub Pages at https://google.github.io/googletest/. We recommend browsing the documentation on GitHub Pages rather than directly in the repository.

In https://google.github.io/googletest/reference/assertions.html#binary-comparison the link appears to work fine.

terokinnunen avatar Jan 04 '23 17:01 terokinnunen