How to direct a link to another tab in .Md files

Hi all,

I have used the below to go to facebook page in my md file. Now the link is opening in the samepage. How can I make it to open in another tab

Visit the full-page app at [Go to application](https://www.facebook.com/)

With Rmarkdown and pandoc, you can add the correct target attribute this way

Visit the full-page app at [Go to application](https://www.facebook.com/){target="_blank"}

This will create the correct link html tag that opens in another tab.

Hope it helps !

3 Likes

Hi Thanks for the suggestion. this is not working in .md file. This is creating somewhat like below in the output html. In RMD file this is happening. But not in .md file. May I know the reason?

Visit the full-page app at Go to application{target="_blank"}

How are you generating the html file ? The pandoc extension needs to be activated if not. In Rmd document with html_document output, it is by default. hence my answer.

Can you give details so I can reproduce ?

I am generating html files through .md files. I do not have rmd files for my website. Do you need more details? :slight_smile:

What are you using to do that ? Your issue is labeled R markdown so I assumed you used Rmarkdown but I am not sure now.

Are you using rmarkdown::render ? knitr::knit ? Are you using pandoc markdown ? Other thing ?

yes some details would be nice to know what we are talking about here.

know that you can often use html directly in your md document to put a link that opens in a new tab

 <a href="https://www.facebook.com/" target="_blank">Go to application</a> 

The syntax I suggested requires pandoc and link_attributes extension, that is by default I think in Rmarkdown.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.