Skip to content

Inline icons have no padding in collapsible block titles #184

@aimurphy

Description

@aimurphy

I don't know if this is a bug or AsciiDoc behaving as expected. I noticed this when testing a layout for the driver docs.

Background

In the driver docs I have a bunch of collapsibles like this:

.C/{cpp} driver TOPIC
[%collapsible]
====
====

.C# driver TOPIC
[%collapsible]
====
====

.GoCQL driver TOPIC
[%collapsible]
====
====

//and so on for all 8 driver languages.

They look kind of bland on their own (just plain text with the little collapsible arrow). So I though I would put the language icons in the block titles, like we have on the Serverless integrations:

Image

I used the above svg macro as a test in the driver docs.
Here's the code from the above heading in the Serverless docs:

=== svg:common::icons/logos/unstructured.svg[role="icon"] Load unstructured vector data

First test: svg macro + text

I transplanted the svg macro to the driver docs like so:

.svg:common::icons/logos/unstructured.svg[role="icon"] C/{cpp} driver retry policies
[%collapsible]
====
====

However, it rendered without the space between the svg and C/C++, even though there is a space in the source:

Image

Second test: attribute + text

Next, I tried using an attribute for the icon, but it still rendered without the space between the icon and C/C++.
This makes me think that the whitespace issues is happening because of the svg.

.{icontest} C/{cpp} driver retry policies
[%collapsible]
====
====

Third test: Forced whitespace

I had to use a forced whitespace character to insert a space between the icon and the text of the block title:

.svg:common::icons/logos/unstructured.svg[role="icon"] C/{cpp} driver retry policies
[%collapsible]
====
====

Image

Additional test

To see if the issue was specific to SVG, I also tried an icon macro.
The attribute resolves to icon:ban[alt="Not compatible",title="Not compatible"].

.{icon-not-compatible} C/{cpp} driver retry policies
[%collapsible]
====
====

But this also had no whitespace:

Image

Conclusion

I don't think forced whitespace is a best practice, so I decided not to pursue the icons for now.

If this is expected behavior, then please close this issue.

Otherwise, it's low priority for now; these icons would be purely cosmetic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions