18F / hub

DEPRECATED: Documentation hub for the 18F team
https://github.com/18F/handbook
Other
46 stars 33 forks source link

Anchor links aren't working #587

Closed nicoleslaw closed 8 years ago

nicoleslaw commented 8 years ago

Previously, the anchor links in the handbook would work two ways, for example: #heading-2 or #heading-name. The second style doesn't seem to be working anymore. Example: https://handbook.18f.gov/travel-101/#travel-card

andrewmaier commented 8 years ago

@nicoleslaw I don't think anyone's changed this code that adds the "heading-x" ids to the heading elements. You can manually add an id to any heading if you want to give it a specific name. If you do, that element doesn't get an auto-generated ("heading-x") id.

nicoleslaw commented 8 years ago

Shouldn't <a name="setup"></a> work here as well? I am so confused as to why it stopped working. https://handbook.18f.gov/github/#setup

andrewmaier commented 8 years ago

I believe you want <a id="setup">

nicoleslaw commented 8 years ago

I tried that first...reverted and it's still not working: https://handbook.18f.gov/github/#setup

nicoleslaw commented 8 years ago

The links are even more confusing now, ex: https://handbook.18f.gov/equipment/#a-idleaving-18fleaving-18fa

andrewmaier commented 8 years ago

@nicoleslaw So in this case we should remove the anchors surrounding the headings if at all possible. Otherwise I can rewrite the code to anticipate anchors around headings.

nicoleslaw commented 8 years ago

I don't understand why it was working either way (with or without an anchor link id)—and now it isn't working :(

andrewmaier commented 8 years ago

@nicoleslaw Looking into it right now. My hunch is that the code is creating invalid HTML which confuses the browser.