markdown link to header
I'm using GitLab to write a read.me file.
I tried to create a link to a header. According to the wiki an id should be automatically created:
see here
I created a header using:
### 1. This is my Header
and tried to create a link to it:
[link](#1--this-is-my-header)
but it is not working.
What am I doing wrong?
hyperlink gitlab markdown
add a comment |
I'm using GitLab to write a read.me file.
I tried to create a link to a header. According to the wiki an id should be automatically created:
see here
I created a header using:
### 1. This is my Header
and tried to create a link to it:
[link](#1--this-is-my-header)
but it is not working.
What am I doing wrong?
hyperlink gitlab markdown
Probably unrelated to programming. (GitLab? Tool used by programmers? I'm not sure)
– user202729
Jul 7 at 9:27
stackoverflow.com/questions/13757329/… ?
– user202729
Jul 7 at 9:28
@user202729 not sure how to use the #toc_4 headers. If I only write[link](#toc_4)
it does not link to the 4th header
– user7431005
Jul 7 at 9:32
add a comment |
I'm using GitLab to write a read.me file.
I tried to create a link to a header. According to the wiki an id should be automatically created:
see here
I created a header using:
### 1. This is my Header
and tried to create a link to it:
[link](#1--this-is-my-header)
but it is not working.
What am I doing wrong?
hyperlink gitlab markdown
I'm using GitLab to write a read.me file.
I tried to create a link to a header. According to the wiki an id should be automatically created:
see here
I created a header using:
### 1. This is my Header
and tried to create a link to it:
[link](#1--this-is-my-header)
but it is not working.
What am I doing wrong?
hyperlink gitlab markdown
hyperlink gitlab markdown
asked Jul 7 at 9:23
user7431005
980215
980215
Probably unrelated to programming. (GitLab? Tool used by programmers? I'm not sure)
– user202729
Jul 7 at 9:27
stackoverflow.com/questions/13757329/… ?
– user202729
Jul 7 at 9:28
@user202729 not sure how to use the #toc_4 headers. If I only write[link](#toc_4)
it does not link to the 4th header
– user7431005
Jul 7 at 9:32
add a comment |
Probably unrelated to programming. (GitLab? Tool used by programmers? I'm not sure)
– user202729
Jul 7 at 9:27
stackoverflow.com/questions/13757329/… ?
– user202729
Jul 7 at 9:28
@user202729 not sure how to use the #toc_4 headers. If I only write[link](#toc_4)
it does not link to the 4th header
– user7431005
Jul 7 at 9:32
Probably unrelated to programming. (GitLab? Tool used by programmers? I'm not sure)
– user202729
Jul 7 at 9:27
Probably unrelated to programming. (GitLab? Tool used by programmers? I'm not sure)
– user202729
Jul 7 at 9:27
stackoverflow.com/questions/13757329/… ?
– user202729
Jul 7 at 9:28
stackoverflow.com/questions/13757329/… ?
– user202729
Jul 7 at 9:28
@user202729 not sure how to use the #toc_4 headers. If I only write
[link](#toc_4)
it does not link to the 4th header– user7431005
Jul 7 at 9:32
@user202729 not sure how to use the #toc_4 headers. If I only write
[link](#toc_4)
it does not link to the 4th header– user7431005
Jul 7 at 9:32
add a comment |
1 Answer
1
active
oldest
votes
In the Documentation you link to we learn that...
The IDs are generated from the content of the header according to the
following rules:
- All text is converted to lowercase.
- All non-word text (e.g., punctuation, HTML) is removed.
- All spaces are converted to hyphens.
- Two or more hyphens in a row are converted to one.
- If a header with the same ID has already been generated, a unique incrementing number is appended, starting at 1.
Note rule 4: "Two or more hyphens in a row are converted to one." However, the example you tried has two hyphens in a row (after the 1
). Remove one of them and you should have it.
[link](#1-this-is-my-header)
From time to time I have encountered a unique header which is converted into an ID in some non-obvious way. A quick way to work out the ID is to use your browser's view source
and/or inspect
tools to view the HTML source code. For example, you might find the following HTML for your example:
<h3 id="1-this-is-my-header">1. This is my Header</h3>
Then just use the contents of the id
attribute with a hash to link to that header: #1-this-is-my-header
.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51221730%2fmarkdown-link-to-header%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In the Documentation you link to we learn that...
The IDs are generated from the content of the header according to the
following rules:
- All text is converted to lowercase.
- All non-word text (e.g., punctuation, HTML) is removed.
- All spaces are converted to hyphens.
- Two or more hyphens in a row are converted to one.
- If a header with the same ID has already been generated, a unique incrementing number is appended, starting at 1.
Note rule 4: "Two or more hyphens in a row are converted to one." However, the example you tried has two hyphens in a row (after the 1
). Remove one of them and you should have it.
[link](#1-this-is-my-header)
From time to time I have encountered a unique header which is converted into an ID in some non-obvious way. A quick way to work out the ID is to use your browser's view source
and/or inspect
tools to view the HTML source code. For example, you might find the following HTML for your example:
<h3 id="1-this-is-my-header">1. This is my Header</h3>
Then just use the contents of the id
attribute with a hash to link to that header: #1-this-is-my-header
.
add a comment |
In the Documentation you link to we learn that...
The IDs are generated from the content of the header according to the
following rules:
- All text is converted to lowercase.
- All non-word text (e.g., punctuation, HTML) is removed.
- All spaces are converted to hyphens.
- Two or more hyphens in a row are converted to one.
- If a header with the same ID has already been generated, a unique incrementing number is appended, starting at 1.
Note rule 4: "Two or more hyphens in a row are converted to one." However, the example you tried has two hyphens in a row (after the 1
). Remove one of them and you should have it.
[link](#1-this-is-my-header)
From time to time I have encountered a unique header which is converted into an ID in some non-obvious way. A quick way to work out the ID is to use your browser's view source
and/or inspect
tools to view the HTML source code. For example, you might find the following HTML for your example:
<h3 id="1-this-is-my-header">1. This is my Header</h3>
Then just use the contents of the id
attribute with a hash to link to that header: #1-this-is-my-header
.
add a comment |
In the Documentation you link to we learn that...
The IDs are generated from the content of the header according to the
following rules:
- All text is converted to lowercase.
- All non-word text (e.g., punctuation, HTML) is removed.
- All spaces are converted to hyphens.
- Two or more hyphens in a row are converted to one.
- If a header with the same ID has already been generated, a unique incrementing number is appended, starting at 1.
Note rule 4: "Two or more hyphens in a row are converted to one." However, the example you tried has two hyphens in a row (after the 1
). Remove one of them and you should have it.
[link](#1-this-is-my-header)
From time to time I have encountered a unique header which is converted into an ID in some non-obvious way. A quick way to work out the ID is to use your browser's view source
and/or inspect
tools to view the HTML source code. For example, you might find the following HTML for your example:
<h3 id="1-this-is-my-header">1. This is my Header</h3>
Then just use the contents of the id
attribute with a hash to link to that header: #1-this-is-my-header
.
In the Documentation you link to we learn that...
The IDs are generated from the content of the header according to the
following rules:
- All text is converted to lowercase.
- All non-word text (e.g., punctuation, HTML) is removed.
- All spaces are converted to hyphens.
- Two or more hyphens in a row are converted to one.
- If a header with the same ID has already been generated, a unique incrementing number is appended, starting at 1.
Note rule 4: "Two or more hyphens in a row are converted to one." However, the example you tried has two hyphens in a row (after the 1
). Remove one of them and you should have it.
[link](#1-this-is-my-header)
From time to time I have encountered a unique header which is converted into an ID in some non-obvious way. A quick way to work out the ID is to use your browser's view source
and/or inspect
tools to view the HTML source code. For example, you might find the following HTML for your example:
<h3 id="1-this-is-my-header">1. This is my Header</h3>
Then just use the contents of the id
attribute with a hash to link to that header: #1-this-is-my-header
.
edited Nov 22 at 18:06
Vít Kotačka
470420
470420
answered Jul 7 at 18:59
Waylan
11.2k22456
11.2k22456
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51221730%2fmarkdown-link-to-header%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Probably unrelated to programming. (GitLab? Tool used by programmers? I'm not sure)
– user202729
Jul 7 at 9:27
stackoverflow.com/questions/13757329/… ?
– user202729
Jul 7 at 9:28
@user202729 not sure how to use the #toc_4 headers. If I only write
[link](#toc_4)
it does not link to the 4th header– user7431005
Jul 7 at 9:32