Opening a link into a new tab with gt

gt doesn't seem to be able to parse a link that is meant to open in a new tab. For example:

library(tibble)
library(gt)

tibble(
  link = "[RStudio](https://www.rstudio.com/){target='_blank'}"
) %>% 
  gt() %>% 
  fmt_markdown("link")

Results in a link that looks like: RStudio{target='_blank'}

Can anyone recommend a way to format a link such that it open in a new tab using gt and gt::fmt_markdown?

Thanks!

The solution seems to be to provide the raw html as commonmark::markdown_html doesn't support attributes

tibble::tibble(
  link = r"(<p><a href="https://www.rstudio.com/" target="_blank">RStudio</a></p>)"
) %>% 
  gt() %>% 
  fmt_markdown("link")

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.