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

image:[link=] produces no href in -b docbook5 #4385

Open
arcnmx opened this issue Nov 12, 2022 · 4 comments
Open

image:[link=] produces no href in -b docbook5 #4385

arcnmx opened this issue Nov 12, 2022 · 4 comments
Labels
area/docbook Issues related to DocBook output and the DocBook converter compliance

Comments

@arcnmx
Copy link

arcnmx commented Nov 12, 2022

The following example:

image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[link="http://www.apache.org/licenses/LICENSE-2.0"]

produces the following xml via asciidoctor -b docbook5:

<simpara><inlinemediaobject>
    <imageobject>
        <imagedata fileref="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/>
    </imageobject>
    <textobject><phrase>License Apache%202.0 blue</phrase></textobject>
</inlinemediaobject></simpara>

note the lack of any link to http://www.apache.org present 😞

while asciidoctor -b html5 works about as expected:

<p><span class="image">
    <a class="image" href="http://www.apache.org/licenses/LICENSE-2.0">
        <img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License Apache%202.0 blue">
    </a>
</span></p>

Expected Output

I expected something more like this:

<link xlink:href="http://www.apache.org/licenses/LICENSE-2.0"><inlinemediaobject>
      <imageobject>
          <imagedata fileref="https://img.shields.io/badge/License-Apache%202.0-blue.svg" />
      </imageobject>
</inlinemediaobject></link>

(this is what pandoc -t docbook produces at least)

Version

Asciidoctor 2.0.18 [https://asciidoctor.org]
Runtime Environment (ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

@arcnmx
Copy link
Author

arcnmx commented Nov 12, 2022

#2018 seems related but is about block images (and proposes an extension to the syntax?). What pandoc does for inline images appears to just be how it's meant to work.

@arcnmx
Copy link
Author

arcnmx commented Nov 12, 2022

Also related to image macros and the docbook backend, titles just don't get converted at all?

asciidoctor -s -b docbook5 - <<< 'image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[alt,title="License"]'
<simpara><inlinemediaobject>
<imageobject>
<imagedata fileref="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/>
</imageobject>
<textobject><phrase>alt</phrase></textobject>
</inlinemediaobject></simpara>

(note the lack of "License" appearing anywhere)

@mojavelinux
Copy link
Member

Your observation is correct that support for the link attribute on the image macros has never been added to the DocBook converter. If you, or someone else who is available, submits a PR to implement it, I will review it and see that it gets merged into main for the next minor release (2.1.x).

@mojavelinux
Copy link
Member

Also related to image macros and the docbook backend...

Please keep issues to a single topic.

@mojavelinux mojavelinux added compliance area/docbook Issues related to DocBook output and the DocBook converter labels Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docbook Issues related to DocBook output and the DocBook converter compliance
Projects
None yet
Development

No branches or pull requests

2 participants