tirralirra12
tirralirra12

Reputation: 21

How do I include an image in a nested list with Asciidoc without the image tabbing over?

I want to include an image at the end of an ordered, nested list using Asciidoc. For example:

. Item
.. Option A
.. Option B
... Sub-option B.1
+
image::

However, the image ends up getting tabbed to be even with the third bullet. Is there any way to keep the image on the same vertical line as the first bullet?

Getting rid of the + before the image doesn't work, because then the numbering on subsequent items in the ordered list gets thrown off.

Upvotes: 2

Views: 1105

Answers (1)

eskwayrd
eskwayrd

Reputation: 4521

Yes, there is a way.

The image should be part of the first bullet, but there are other elements in between. So, you have to group those other elements — an "open block" does the trick:

. Item
+
--
.. Option A
.. Option B
... Sub-option B.1
--
+
image::

See "Open Blocks" for details: https://asciidoctor.org/docs/user-manual/#open-blocks

Upvotes: 2

Related Questions