Markdown cheatsheet · Links
Markdown links
The visible text goes in square brackets, the URL in parentheses, nothing in between: [text](url).
The syntax
Try [maxdown](https://maxdown.app), a native markdown editor.
Try maxdown, a native markdown editor.
To show a bare URL as a clickable link, wrap it in angle brackets. Many renderers (GFM included) also auto-link plain https:// URLs without the brackets.
<https://maxdown.app>
Link titles
A quoted string after the URL becomes the tooltip shown on hover.
[maxdown](https://maxdown.app "Markdown to the max")
maxdown (hover it)
Linking to a heading on the same page
Most renderers give every heading an automatic anchor: the text lowercased, spaces replaced by dashes, punctuation removed. Link to it with a #. The exact slug rules are fiddly enough to trip most people up; anchor links covers them in full.
See [the setup guide](#getting-started). ## Getting started
See the setup guide.
Reference-style links
For prose with many links, you can keep URLs out of the text: use a label in a second pair of brackets, and define it anywhere in the document (usually at the bottom).
Built with [Rust][1] and [Tauri][tauri]. [1]: https://www.rust-lang.org [tauri]: https://tauri.app
Spaces and parentheses in URLs
A space breaks the URL parsing. Either encode it as %20 or wrap the URL in angle brackets: [notes](<my file.md>). A closing parenthesis inside a URL (common with Wikipedia) should be escaped as \) or the URL wrapped the same way.
Opening a link in a new tab
Plain markdown can't do this. A [text](url) link always opens in the same tab, because markdown has no place to put the target that controls it. Where inline HTML is allowed, drop to an anchor tag:
<a href="https://maxdown.app" target="_blank" rel="noopener">maxdown</a>
maxdown (opens in a new tab)
rel="noopener". Without it, the page you open can reach back to yours through window.opener, a real security and performance issue. The thin pages that answer this question with just target="_blank" leave it out. It costs nothing and closes the hole.Two caveats: GitHub strips target for security, so on GitHub every link opens in the same tab no matter what; and forcing new tabs is widely disliked because it takes the back button away from the reader. Use it sparingly, if at all.
Common questions
Can I make an image a link?
Yes: put the image inside the link text, [](https://example.com). See the images guide.