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?
像这样编织:
library(knitr)
knit2html('that_file.Rmd', 'that_file.html')
这导致所有这些东西都成为链接。
是否有一种简单的方法通常保持自动链接生成,但有选择性地在特定行中禁用它?感谢任何想法。
编辑:在接受之前,我想我应该实际尝试下面的解决方案。这是在.Rmd文件中:
I don't want this <!-- breaklink -->@to-be-a-link.com
实际上,这并不是一个HTML注释,因为--被转换成了em dash(是由knitr?pandoc?完成的),然后我得到了:
<!-- -->
的内容插入URL作为一部分来“破坏”链接... - A5C1D2H2I1M1N2O1R2T1