0

我想使用 asciidoctorj 创建一个带有 ID 的外部链接。我在手册中的任何地方都找不到如何做到这一点的方法。

Asciidoctor 来源:

http://stackoverflow.com[Cool Site, id="myId"] ...

当前结果:

<a href="http://stackoverflow.com">Cool Site</a> ...

预期结果:

<a id="myId" href="http://stackoverflow.com">Cool Site</a> ...
4

1 回答 1

1

I don't think it's possible (for now): http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#links

But you can define role to produce HTML class, for example:

http://discuss.asciidoctor.org[Discuss Asciidoctor, role="external"]

will produce:

<a href="http://discuss.asciidoctor.org" class="external">Discuss Asciidoctor</a>

You can also open an issue here to ask for it!

于 2014-05-27T18:00:24.743 回答