Skip to content

Same reference for multiple heading #18

Open
@RadhiFadlillah

Description

For example, I have a markdown file like this :

# General

## General

### General

This package will render all headings with same reference :

<h1>
	<a name="general" class="anchor" href="#general" rel="nofollow" aria-hidden="true">
		<span class="octicon octicon-link"></span>
	</a>General
</h1>
<h2>
	<a name="general" class="anchor" href="#general" rel="nofollow" aria-hidden="true">
		<span class="octicon octicon-link"></span>
	</a>General
</h2>
<h3>
	<a name="general" class="anchor" href="#general" rel="nofollow" aria-hidden="true">
		<span class="octicon octicon-link"></span>
	</a>General
</h3>

While GitHub will render each heading with different reference :

<h1>
	<a id="user-content-general" class="anchor" href="#general" aria-hidden="true"></a>General
</h1>
<h2>
	<a id="user-content-general-1" class="anchor" href="#general-1" aria-hidden="true"></a>General
</h2>
<h3>
	<a id="user-content-general-2" class="anchor" href="#general-2" aria-hidden="true"></a>General
</h3>

By the way, name attribute in a is now obsolete in HTML5, so it might be a good idea to move the name attribute into id like GitHub did.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions