Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: inconsistent ID remapping with headers as HTML links #54051

Open
ainar-g opened this issue Jul 25, 2022 · 0 comments
Open

x/pkgsite: inconsistent ID remapping with headers as HTML links #54051

ainar-g opened this issue Jul 25, 2022 · 0 comments
Labels
pkgsite/frontend pkgsite

Comments

@ainar-g
Copy link
Contributor

@ainar-g ainar-g commented Jul 25, 2022

What is the URL of the page with the issue?

(Self-hosted.)

What is your user agent?

(Any; the issue is with the Markdown renderer.)

Screenshot

Screenshot 2022-07-25

(Personal information removed.)

What did you do?

  1. Init an empty Go module.

  2. Add a readme with the following content:

     #  Test
    
    ##  Table Of Contents
    
     *  [Section](#my-section-id)
         *  [Subsection](#my-subsection-id)
    
    ##  <a href="#my-section-id" id="my-section-id">Section</a>
    
       ###  <a href="#my-subsection-id" id="my-subsection-id">Subsection</a>
  3. Launch pkgsite, navigate to the page of the module, and expand the documentation.

What did you expect to see?

Either HTML IDs being remapped in both the ToC and the headers or no remapping at all.

What did you see instead?

The ToC links are remapped to #readme-my-section-id and #readme-my-subsection-id respectively, while the IDs in headers stay the same, which makes the table of contents links useless.

Additional notes

The ultimate goal is to have a Markdown file with a table of contents and clickable headers that has the same interactive functionality in all Markdown renderers that matter. Which includes most Git hosting sites as well as pkg.go.dev. The former all work, but the latter has HTML ID issues.

@gopherbot gopherbot added this to the Unreleased milestone Jul 25, 2022
@hyangah hyangah added the pkgsite/frontend label Jul 26, 2022
@hyangah hyangah modified the milestones: Unreleased, pkgsite/unplanned Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkgsite/frontend pkgsite
Projects
None yet
Development

No branches or pull requests

3 participants