awunderground
awunderground

Reputation: 134

How do I turn off url printing for html docs from R Markdown

I created an .html document using R Markdown. Embedded links show up in parentheses when I print the document (ink and paper printing).

Input:

---
title: ''
author: ''
output: html_document
---

[Google](https://www.google.com/)

Printed output:

Google (https://www.google.com/)

Is there a way to override this feature? Is this because of R Markdown, Markdown, or Pandoc?

Upvotes: 1

Views: 155

Answers (1)

tarleb
tarleb

Reputation: 22609

This is an R Markdown feature: the default CSS contains the equivalent of the following style definition, which causes this behavior:

@media print{
  a[href]:after{
    content:" (" attr(href) ")"
  }
}

You can overwrite this with your own CSS, e.g.:

---
title: ''
author: ''
output: html_document
---

```{=html}
<style>
@media print{
  a[href]:after{
    content:""!important;
  }
}
</style>
```

[Google](https://www.google.com/)

Upvotes: 1

Related Questions