[Link Text](link-address)
[Link Text](link-address "optional title")
Protocols like http://
cannot be omitted for this type of syntax.
[Link Text][Ref]
[Ref]: link-address "optional title"
or, it can be shorten as
[Ref][]
[Ref]: link-address
Protocols like http://
cannot be omitted for this type of syntax.
<http://typora.io>
Typora can automatically detect url link in markdown, and render them as URL link, but please note that other markdown engines may not support this.
This is a link: http://typora.io
<a>
tagYou could also use raw HTML to add links, for example
<a href="http://www.google.com" target="__blank">Link to Google</a>
<a name="anchor"></a> Anchor
<a href="#anchor">Link to Anchor</a>
For link towards a website, we suggest you DO NOT omit URL protocols like https://
or http://
, or it may be interpreted as relative link by Typora or other Markdown engines, or after export/publish.
You could use write relative or absolute path as link address towards a local file, the extension like (.md) can be omitted, for example:
[Readme1](Readme1.md)
[Readme2](../Docs/Readme2.markdown)
[Readme3](Readme3)
[Readme4](/User/root/Docs/Readme1.md)
[Readme4](C:/Develop/Docs/Readme1.md)
[Readme4](file:///User/root/Docs/Readme1.md)
Please note that, for relative link address, it will not be converted into real absolute file path when export as HTML based on Markdown’s spec.
You can use #
to create links towards any headings in your markdown file, for example:
# This is a title
...
...
...
A [link](#this-is-a-title) to jump towards target heading
If there are duplicated headings, add numbered suffix starting from -1
, e.g:
# Hello
...
# Hello
...
A [link](#hello-1) to first heading, a [link](#hello-2) to second one.
You could also write named anchors using raw HTML:
<a id="anchor"></a> Anchor
<a href="#anchor">Link to Anchor</a>
To, hide the empty <a>
, you could add following in custom CSS (#2921):
/* hide the anchor HTML */
a[name]:empty + .md-raw-inline {
display:none;
}
a[name]:empty {
text-decoration: none;
}
a[name]:empty:before {
content:"⚓";
}
/* show the anchor HTML when cursor is inside */
.md-expand .md-raw-inline {
display: inline !important;
}
You can use command+click
(macOS), or ctrl+click
(Linux/Windows) on links in Typora to jump to target headings, or open them in Typora, or open in related apps.
/abc.com
, do you mean http://abc.com ?” shows when I trying to open the linkIf you want to make a link to local file abd.com
, please make ensure the path is correct.
If you want to create a link towards website “abc.com”, you need to put the URL scheme or protocol, for example use [link](http://abc.com)
.
Sometimes, protocol can be omitted if you use autolink (<www.google.com>
) or auto URL (www.google.com
), but this rules variables across different Markdown editors/engines, so we will recommend you NOT omit protocols in any case for less compatibility issue.
file.md
, would you want to create file at folder/file.md
and continue?If you add link to local file, but target file does not exists, this tooltip will shows and guide you to create a file at target location.