避免使用knitr、markdown自动生成超链接
避免使用knitr、markdown自动生成超链接,r,markdown,knitr,pandoc,R,Markdown,Knitr,Pandoc,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
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?
结果所有这些都是链接
是否有一种简单的方法来保持自动链接生成,但在特定线路中有选择地禁用它?谢谢你的想法
编辑:我想我应该在接受之前尝试一下下面的解决方案。这个在.Rmd中
I don't want this <!-- breaklink -->@to-be-a-link.com
我不想要这个@to-be-a-link.com
…实际上并没有解析为HTML注释,因为--被更改为em破折号(由knitr?pandoc?)然后我得到:
我看到的两个选项是(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?
---
标题:“文件标题”
输出:html\u文档
---
我不想要this@to-be-a-link.com,但结果是这样的。
如果你把它包装成一个R表达式`this@is-still-a-link.com`。
如果我想的话,有没有什么CSS技巧我可以利用
http://www.something.com 不
是链接吗?
变成:
您只是不希望它显示为链接还是完全删除链接?另外,为什么在第二次尝试中使用R表达式而不仅仅是简单的反勾号呢?这似乎有点老套,但您可以使用类似于作为URL一部分插入的
之类的内容来“断开”链接……我不想要简单的反勾号版本,因为我想要纯文本输出。我没想到R表达式一定会起作用,但它只是展示了我试图/扔到墙上的东西。我想这可能是一个潘多克问题,真的。。。。我发布的答案似乎适用于HTML和DOCX,但不适用于PDF。@arvi1000,好吧,这是一条注释——所以你可以把它写得很详细,比如this@to-be-a-link.com
:-)
---
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?