我可以创建链接'target =“_blank”“在减价? [英] Can I create links with 'target="_blank"' in Markdown?
问题描述
有没有在Markdown中创建链接的方法,可以在新窗口中打开?如果不是,你推荐什么语法来做到这一点。我将它添加到我使用的markdown编译器中。我认为它应该是一个选项。
Is there a way to create a link in Markdown that opens in a new window? If not, what syntax do you recommend to do this. I'll add it to the markdown compiler I use. I think it should be an option.
推荐答案
就Markdown语法而言,如果您想获得详细信息,您只需使用HTML。
As far as the Markdown syntax is concerned, if you want to get that detailed, you'll just have to use HTML.
<a href="http://example.com/" target="_blank">Hello, world!</a>
我见过的大多数Markdown引擎都允许使用普通的HTML,只是针对这种情况,标记系统不会削减它。 (例如,StackOverflow引擎)。然后,他们通过HTML白名单筛选器运行整个输出,因为即使是仅Markdown文档也可以轻松包含XSS攻击。因此,如果您或您的用户想要创建 _blank
链接,那么他们可能仍然可以。
Most Markdown engines I've seen allow plain old HTML, just for situations like this where a generic text markup system just won't cut it. (The StackOverflow engine, for example.) They then run the entire output through an HTML whitelist filter, regardless, since even a Markdown-only document can easily contain XSS attacks. As such, if you or your users want to create _blank
links, then they probably still can.
如果这是一个你将经常使用的特性,创建自己的语法可能是有意义的,但它通常不是一个重要的特性。如果我想在新窗口中启动该链接,我会按住Ctrl键单击它,谢谢。
If that's a feature you're going to be using often, it might make sense to create your own syntax, but it's generally not a vital feature. If I want to launch that link in a new window, I'll ctrl-click it myself, thanks.
这篇关于我可以创建链接'target =“_blank”“在减价?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!