Skip to content

Header anchor link hrefs are wrong (no user-content- added) #24

@mb185390

Description

@mb185390

When adding a Table of Contents as follows:

# Table of Contents

* [1. Introduction](#user-content-1-introduction)

and the corresponding heading like so:

# 1. Introduction

An anchor link is generated inside the header tag:

<a id="user-content-1-introduction" class="anchor" href="#1-introduction" aria-hidden="true">
    <span aria-hidden="true" class="octicon octicon-link"></span>
</a>

Notice the href="#1-introduction" meaning that if I was to right-click the anchor link and copy the address it is copied as "www.example.com/document#1-introduction" so when navigating there it doesn't scroll down to the Introduction section as it can't find the anchor link.

I've tried adding my own custom anchor and setting the name and id to "introduction" to no avail.

Is anyone aware of a fix for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions