Markdown ignores <a name="..."></a> anchors #3175

Closed
opened 2025-11-02 05:02:51 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @rinnaz on GitHub (Apr 11, 2019).

  • Gitea version (or commit ref): 1.7.5
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Moved repo from github to gitea, and it seems that anchor points are not working.
Anchors are made that way:

* [Introduction](#anchor-introduction)

# <a name="anchor-introduction"></a>Introduction
Originally created by @rinnaz on GitHub (Apr 11, 2019). - Gitea version (or commit ref): 1.7.5 - Git version: 2.17.1 - Operating system: Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ## Description Moved repo from github to gitea, and it seems that anchor points are not working. Anchors are made that way: ```markdown * [Introduction](#anchor-introduction) # <a name="anchor-introduction"></a>Introduction ```
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 05:02:51 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jun 10, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jun 10, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@cypriani commented on GitHub (Oct 23, 2019):

The following works for me:

Table of contents
=================

* [Introduction](#introduction)

Introduction <a id="introduction"></a>
============

Blah blah.

Please note I'm using id, not name.

EDIT: <a id="introduction"></a> works fine, but <a id="introduction"/>, although seemingly working, will break subsequent internal links (such as [[otherfile.md]]). Not sure whether or not this is a bug.

@cypriani commented on GitHub (Oct 23, 2019): The following works for me: ``` Table of contents ================= * [Introduction](#introduction) Introduction <a id="introduction"></a> ============ Blah blah. ``` Please note I'm using `id`, not `name`. EDIT: `<a id="introduction"></a>` works fine, but `<a id="introduction"/>`, although seemingly working, will break subsequent internal links (such as `[[otherfile.md]]`). Not sure whether or not this is a bug.
Author
Owner

@guillep2k commented on GitHub (Oct 23, 2019):

There is a closed list of attributes allowed for each element. I'm surprised that id is in the list.

@guillep2k commented on GitHub (Oct 23, 2019): There is a closed list of attributes allowed for each element. I'm surprised that `id` is in the list.
Author
Owner

@zeripath commented on GitHub (Oct 23, 2019):

The IDs come for free from the header elements automatically. Spaces are turned into hyphens.

@zeripath commented on GitHub (Oct 23, 2019): The IDs come for free from the header elements automatically. Spaces are turned into hyphens.
Author
Owner

@wxiaoguang commented on GitHub (Apr 25, 2023):

id is the correct syntax

https://stackoverflow.com/questions/6582233/hash-in-anchor-tags

@wxiaoguang commented on GitHub (Apr 25, 2023): `id` is the correct syntax https://stackoverflow.com/questions/6582233/hash-in-anchor-tags
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3175