markdown link to header












0














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?










share|improve this question






















  • 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
















0














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?










share|improve this question






















  • 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














0












0








0







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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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












1 Answer
1






active

oldest

votes


















1














In the Documentation you link to we learn that...




The IDs are generated from the content of the header according to the
following rules:




  1. All text is converted to lowercase.

  2. All non-word text (e.g., punctuation, HTML) is removed.

  3. All spaces are converted to hyphens.

  4. Two or more hyphens in a row are converted to one.

  5. 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.






share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    1














    In the Documentation you link to we learn that...




    The IDs are generated from the content of the header according to the
    following rules:




    1. All text is converted to lowercase.

    2. All non-word text (e.g., punctuation, HTML) is removed.

    3. All spaces are converted to hyphens.

    4. Two or more hyphens in a row are converted to one.

    5. 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.






    share|improve this answer




























      1














      In the Documentation you link to we learn that...




      The IDs are generated from the content of the header according to the
      following rules:




      1. All text is converted to lowercase.

      2. All non-word text (e.g., punctuation, HTML) is removed.

      3. All spaces are converted to hyphens.

      4. Two or more hyphens in a row are converted to one.

      5. 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.






      share|improve this answer


























        1












        1








        1






        In the Documentation you link to we learn that...




        The IDs are generated from the content of the header according to the
        following rules:




        1. All text is converted to lowercase.

        2. All non-word text (e.g., punctuation, HTML) is removed.

        3. All spaces are converted to hyphens.

        4. Two or more hyphens in a row are converted to one.

        5. 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.






        share|improve this answer














        In the Documentation you link to we learn that...




        The IDs are generated from the content of the header according to the
        following rules:




        1. All text is converted to lowercase.

        2. All non-word text (e.g., punctuation, HTML) is removed.

        3. All spaces are converted to hyphens.

        4. Two or more hyphens in a row are converted to one.

        5. 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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 22 at 18:06









        Vít Kotačka

        470420




        470420










        answered Jul 7 at 18:59









        Waylan

        11.2k22456




        11.2k22456






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            What visual should I use to simply compare current year value vs last year in Power BI desktop

            Alexandru Averescu

            Trompette piccolo