Skip to content

Markdown anchors should not have user-content- prefix in href #11896

Closed
@silverwind

Description

@silverwind

A heading like # Usage generates a anchor user-content-usage-example with same href which is rather ugly in shared links:

<h2 id="user-content-usage">Usage<a href="#user-content-usage"></a></h2>

GitHub and GitLab both do:

<h2><a id="user-content-usage" href="#usage"></a>Usage</h2>

I think we should follow and also omit the user-content prefix in href. This could be a breaking change, but I think we could maybe support both cases to not break existing links.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UI

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions