[go: up one dir, main page]

HTML heading tags in Markdown files do not produce heading fragment copy icons.

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

In files like https://gitlab.com/rokejulianlockhart/rokejulianlockhart/-/blob/27f4161caed95f549a25f253682e52198d1e6ec9/readMe.MD?plain=0, I can solely link to the top heading (via https://gitlab.com/rokejulianlockhart/rokejulianlockhart/-/blob/27f4161caed95f549a25f253682e52198d1e6ec9/readMe.MD?plain=0#profile-biography-and-repository-information) because, as https://gitlab.com/rokejulianlockhart/rokejulianlockhart/-/blob/27f4161caed95f549a25f253682e52198d1e6ec9/readMe.MD?plain=1#L63:~:text=%3C/style%3E-,%23,-Profile%20Biography%20and demonstrates, it is the sole heading defined by Markdown's equivalent to the HTML <h1> tag - #. All of my other headings are formatted as

1.  <details open> <summary> <h2> Table of Contents </h2> </summary>

    Contents

    </sdetails>

which renders as

  1. Table of Contents

    Contents

so that they can be collapsed. However, using the <h2> tag, instead of ##, prevents the GitLab file renderer from creating link icons (so that I can copy a fragment which shall direct the user to the heading).

Steps to reproduce

  1. Create a Markdown file (file.txt.MD).
  2. Input <h1> Heading </h1>.
  3. Notice that GitLab doesn't allow you to link to it.

Example Project

https://gitlab.com/rokejulianlockhart/rokejulianlockhart/-/blob/27f4161caed95f549a25f253682e52198d1e6ec9/readMe.MD?plain=0#profile-biography-and-repository-information

What is the current bug behavior?

However, using the <h2> tag, instead of ##, prevents the GitLab file renderer from creating link icons (so that I can copy a fragment which shall direct the user to the heading).

What is the expected correct behavior?

I should be able to link to HTML headings.

Relevant logs and/or screenshots

Possible fixes

Implement this for HTML heading tags.

Edited by 🤖 GitLab Bot 🤖