避免使用Knitr,Markdown自动生成超链接

arv*_*000 7 markdown r pandoc knitr

knitr将.Rmd编织为.html时会自动生成链接。通常这很有用,但现在不是我想要的。

假设您有以下.Rmd文件:

---
title: "Doc title"
output: html_document
---

I don't want this@to-be-a-link.com, but it comes out that way. 

If you wrap it in an R expression  `r "this@is-still-a-link.com"`.

Is there some kind of CSS trick I can avail myself of if I wanted <style='nolink'>www.something.com</style> not to be a link?
Run Code Online (Sandbox Code Playgroud)

像这样编织:

library(knitr)
knit2html('that_file.Rmd', 'that_file.html')
Run Code Online (Sandbox Code Playgroud)

导致所有这些东西都是链接。

在此处输入图片说明

是否有一种简单的方法通常可以保留自动链接生成,但是在特定的行中有选择地禁用它?感谢您的任何想法。

编辑:我想我应该在接受之前实际尝试过以下解决方案。这在.Rmd

I don't want this <!-- breaklink -->@to-be-a-link.com
Run Code Online (Sandbox Code Playgroud)

...实际上并没有解析为HTML注释,因为-变成了破折号(由knitr?pandoc?),然后我得到:

在此处输入图片说明

A5C*_*2T1 6

我看到的两个选项是(1)使用裸引号,或(2)通过使用空的HTML注释“断开”链接。

例:

---
title: "Doc title"
output: html_document
---

I don't want this<!-- -->@to-be-a-link.com, but it comes out that way. 

If you wrap it in an R expression `this@is-still-a-link.com`.

Is there some kind of CSS trick I can avail myself of if I wanted 
<style='nolink'>http<!-- -->://www.something.com</style> not to 
be a link?
Run Code Online (Sandbox Code Playgroud)

成为:

在此处输入图片说明