Open Markdown links in new tab

0
11
open markdown links in new tab.jpg
open markdown links in new tab.jpg

Is it possible to mark down links so that they open in a new tab? Or do you have to switch to HTML for that?

 

Your Markdown description explains links in detail, but it doesn’t say how to instruct the browser to open the link target in a new tab. Do you really have to switch to HTML for this?

 

You may not have to, but encoding the link as HTML is probably the most widely supported option:

<a href=" target="_blank">c’t</a>

The value _blank in the attribute target instructs browsers to open the URL in a new window or tab. Whether this syntax works depends on the system processing the input. Some software filters out HTML tags or simply cannot map the function of the attribute in a meaningful way – for example, because it generates a PDF file and not a website.

As an alternative, different systems know different markdown extensions to map the target attribute. For example, you can try Pandoc’s link attributes

[c’t](

Kramdown’s span inline attributes

[c’t](

(similar, but with a colon) or the syntax of the CMS Grav

[c’t](

function. The best thing to do is to consult your system’s documentation to find out what syntax it expects and whether it even understands the function.

Previous articleWithings: Several smartwatches and scales are getting more expensive
Next articleReport: TSMC despite reduced orders from probably the world’s largest semiconductor manufacturers
Brian Adam
Professional Blogger, V logger, traveler and explorer of new horizons.