How to link to a named anchor in Multimarkdown?

后端 未结 7 1605
醉酒成梦
醉酒成梦 2020-11-28 17:21

I have come across a number of mentions of MultiMarkdown\'s support for internal links / named anchors but I am unable to find a single example of how to actually do it.

7条回答
  •  佛祖请我去吃肉
    2020-11-28 17:33

    In standard Markdown, place an anchor where you want to link to and refer to it on the same page by [link text](#abcd).

    (This uses name= and not id=, for reasons explained in this answer.)

    Remote references can use [link text](http://...#abcd) of course.

    This works like a dream, provided you have control over the source and target texts. The anchor can even appear in a heading, thus:

    ### A Heading in this SO entry!
    

    produces:

    A Heading in this SO entry!

    and we can even link to it so:

    and we can even [link](#head1234) to it so:
    

    (On SO, the link doesn't work because the anchor is stripped.)

提交回复
热议问题