2017-08-07 28 views
0

我正在为Asciidoctor撰写我正在贡献的项目的发行指南。在Asciidoctor链接描述中引用方括号

该文档包含一个链接,预期的链接描述应该包含像[variable]这样的安置孔。 Asciidoctor alsi使用方括号来包含链接描述,我引用了我的方括号。但结果不是被压抑的结果。

这是我尝试的简单的例子:

Here comes the problem! 

https://dist.apache.org/[https://dist.apache.org/repos/\[version\]\[project\]^]. 

Asciidoctor(1.5.6.1版本)呈现的环节https://dist.apache.org/repos/dist/dev/incubator/tamaya/\[version]/\[project]。但我期望https://dist.apache.org/repos/dist/dev/incubator/tamaya/[version]/\[project]作为结果。

我错过了什么?

回答

1

根据我的经验,使用小数HTML实体代码是解决方案。这应该适用于HTML和PDF。对于您的情况:

我会写:

Here comes the problem! 

https://dist.apache.org/[https://dist.apache.org/repos/[version][project]^]. 

如果使用实体很多,你可以使用变量:

:left_sb: [ 
:rigth_sb: ] 

Here comes the problem! 

https://dist.apache.org/[https://dist.apache.org/repos/{left_sb}version{rigth_sb}{left_sb}project{rigth_sb}^].