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?
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.
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.
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.
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.
Dropping the colon should be enough:
[link](https://example.org){target="_blank"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With