Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandoc: Open link in new tab

According to this answer, it should be possible to use the following syntax

[link](url){:target="_blank"}

to have links opening in a new tab when using pandoc.

However, it seems this option is not supported as the option is not recognized when converting to html.

I am using rmarkdown which relies on pandoc in the background.

Is it possible to do so using pandoc and if yes, how?

like image 633
pat-s Avatar asked Jan 28 '18 13:01

pat-s


People also ask

How do I make a link open in a new tab in markdown?

Using Anchor tags You just add the target="_blank" attribute to your anchor tag so the links open up in a different browser tab. The only downside to this is that your markdown document is no longer purely markdown as it contains HTML. This may or may not be a problem depending on your use case.

How do I make a link open in a new tab in github?

Use the Kramdown processor instead of GFM will allow you to add {:target="_blank" rel="noopener"} to markdown links to tell the browser to open link in new tab.

How do you add an external link in markdown?

You can find out the link to a page heading by clicking on link icon that appears when you hover over a heading. After you click on the link symbol, the url to that heading will be in your browsers address bar. Copy the link and strip off the method and domain to make a relative url.

Does Rmarkdown use Pandoc?

The R package rmarkdown is a library which proceses and converts . Rmd files into a number of different formats. The core function is rmarkdown::render which stands on the shoulders of pandoc. This function 'renders the input file to the specified output format using pandoc.


1 Answers

Dropping the colon should be enough:

[link](https://example.org){target="_blank"}
like image 144
tarleb Avatar answered Oct 14 '22 05:10

tarleb