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

Indentation issues in description lists with tagged regions #3693

Closed
lcawl opened this issue Jun 25, 2020 · 1 comment
Closed

Indentation issues in description lists with tagged regions #3693

lcawl opened this issue Jun 25, 2020 · 1 comment
Assignees
Labels
bug compliance v2.0.21 Issues resolved in the 2.0.21 release
Milestone

Comments

@lcawl
Copy link

lcawl commented Jun 25, 2020

While playing with description lists, I noticed that the first item in the list is often indented improperly (i.e. not indented).

Here's a simple example involving a glossary of terms:

= Link test

:doctype:           book

== Glossary

L::

[[glossary-leader-index]] leader index:::
+
--
include::test-glossary.asciidoc[tag=leader-index-def]
--

[[glossary-local-cluster]] local cluster:::
+
--
include::test-glossary.asciidoc[tag=local-cluster-def]
--

M::

microwave:::
Test

muffin:::
Test

The two terms that use tagged regions are pulling them from a file that contains content like this:

[[glossary-leader-index]] leader index ::  
// tag::leader-index-def[]
My definition for leader index.
// end::leader-index-def[]

[[glossary-local-cluster]] local cluster ::
// tag::local-cluster-def[]
My definition for local cluster.
// end::local-cluster-def[]

When I build this page (e.g. asciidoctor test.asciidoc -D output/docs), you can see that the "leader index" description is not indented properly:

image

It seems to consistently be a problem only for the first item in the list. When I inspect the output, it seems to show that the <dd> is missing as follows:

<dl>
--
  | <dt class="hdlist1">L</dt>
  | <dd>
  | <div class="dlist">
  | <dl>
  | <dt class="hdlist1"><a id="glossary-leader-index"></a> leader index</dt>
  | </dl>
  | </div>
  | <div class="openblock">
  | <div class="content">
  | <div class="paragraph">
  | <p>My definition for leader index.</p>
  | </div>
  | </div>
  | </div>
  | <div class="dlist">
  | <dl>
  | <dt class="hdlist1"><a id="glossary-local-cluster"></a> local cluster</dt>
  | <dd>
  | <div class="openblock">
  | <div class="content">
  | <div class="paragraph">
  | <p>My definition for local cluster.</p>
  | </div>
  | </div>
  | </div>
  | </dd>
  | </dl>
  | </div>
  | </dd>

I can work around the problem by omitting the continuation character from the first entry in each list. For example:

L::

[[glossary-leader-index]] leader index:::
include::test-glossary.asciidoc[tag=leader-index-def]

[[glossary-local-cluster]] local cluster:::
+
--
include::test-glossary.asciidoc[tag=local-cluster-def]
--

But that work-around falls apart when there happen to be more than one paragraph in the tagged region. For example:

image

@mojavelinux
Copy link
Member

mojavelinux commented Nov 3, 2023

The includes are a red herring here. This happens even without them. The problem seems to be the empty line after the terms in the outermost list:

L::

leader index:::
+
--
My definition for leader index.
--

local cluster:::
+
--
My definition for local cluster.
--

M::

microwave:::
Test

muffin:::
Test

If those lines are removed, it behaves as expected:

L::
leader index:::
+
--
My definition for leader index.
--

local cluster:::
+
--
My definition for local cluster.
--

M::
microwave:::
Test

muffin:::
Test

The expectation is that those empty lines between nested lists don't impact parsing. I'll try to track down why this is happening.

mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Nov 3, 2023
…k if offset from parent list by empty line
@mojavelinux mojavelinux self-assigned this Nov 3, 2023
@mojavelinux mojavelinux added the bug label Nov 3, 2023
@mojavelinux mojavelinux added this to the v2.0.x milestone Nov 3, 2023
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Nov 5, 2023
…k if offset from parent list by empty line
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Nov 5, 2023
…k if offset from parent list by empty line
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Nov 5, 2023
…k if offset from parent list by empty line
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Nov 7, 2023
…k if offset from parent list by empty line
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Feb 20, 2024
…k if offset from parent list by empty line
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Feb 20, 2024
…k if offset from parent list by empty line
@mojavelinux mojavelinux added compliance v2.0.21 Issues resolved in the 2.0.21 release labels Feb 20, 2024
mojavelinux added a commit that referenced this issue Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compliance v2.0.21 Issues resolved in the 2.0.21 release
Projects
None yet
Development

No branches or pull requests

3 participants
@mojavelinux @lcawl and others