Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for linkattrs #726

Open
lcawl opened this issue Mar 15, 2019 · 3 comments
Open

Fix support for linkattrs #726

lcawl opened this issue Mar 15, 2019 · 3 comments
Labels
asciidoc Asciidoc and our Asciidoctor extensions defer

Comments

@lcawl
Copy link
Contributor

lcawl commented Mar 15, 2019

Per #505 (comment), I would like to use the linkattrs functionality described here:

https://asciidoctor.org/docs/asciidoc-writers-guide/#target-window-and-role-attributes-for-links

When I try any of the examples there in the Glossary, for example:

== Introduction

:linkattrs:

Chat with other Asciidoctor users on the http://discuss.asciidoctor.org/[*mailing list*^, role="green"].

the attributes are not recognized. They're output as:

<a class="ulink" href="http://discuss.asciidoctor.org/" target="_top"><span class="strong strong"><strong>mailing list</strong></span>^, role="green"</a>

@nik9000 nik9000 self-assigned this Mar 15, 2019
@nik9000
Copy link
Member

nik9000 commented Mar 15, 2019

I dug into this. It doesn't work for a whole stack of reasons:

  1. Docbook 4.5 doesn't support it. Docbook 5 might, I'm not sure.
  2. We force compat-mode on all of the documents. We probably shouldn't but we do. That seem like a thing for another time though. When we're in compat-mode we can't use linkatts.

We should fix compat-mode. Beyond that, though, we probably won't be able to use these until we take another look at docbook.

@nik9000
Copy link
Member

nik9000 commented Mar 15, 2019

I filed #728 for us to get off compat-mode.

@lcawl
Copy link
Contributor Author

lcawl commented Mar 15, 2019

You're right, it works when I disable compat-mode, enable linkattrs and use a default Asciidoctor -> HTML build. It does not seem to work with docbook or docbook5

asciidoctor index.asciidoc -b docbook45 yields:

<simpara>Chat with other Asciidoctor users on the <ulink url="http://discuss.asciidoctor.org/"><emphasis role="strong">mailing list</emphasis></ulink>.</simpara>

asciidoctor index.asciidoc -b docbook5 yields:

<simpara>Chat with other Asciidoctor users on the <link xl:href="http://discuss.asciidoctor.org/"><emphasis role="strong">mailing list</emphasis></link>.</simpara>

asciidoctor index.asciidoc -b html and -b xhtml yield:

<p>Chat with other Asciidoctor users on the <a href="http://discuss.asciidoctor.org/" class="green" target="_blank" rel="noopener"><strong>mailing list</strong></a>.</p>

@gtback gtback added the asciidoc Asciidoc and our Asciidoctor extensions label May 14, 2020
@gtback gtback added the defer label Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asciidoc Asciidoc and our Asciidoctor extensions defer
Projects
None yet
Development

No branches or pull requests

3 participants