#### 24.5.11 Configuring multi-paragraph list items

By default, at the end of each paragraph DITA2Go closes the block element to which the paragraph format is mapped (see §24.4.3 Mapping paragraph formats to DITA block elements). If any list items in your document include multiple paragraphs or sublists, you must make sure that each <li> can include more than one block element, but also that the last item in each list or sublist does not slurp up any following paragraphs.

To configure list elements:

Map formats to <p> instead of <li>.

Specify ancestry for each format.

Make each format first in <li>.

Make sure each list ends where it should.

Map formats to <p> instead of <li>

Map all list-item paragraph formats to <p> rather than to <li>; for example:

    [DITAParaTags]
    Numbered1 = p
    Numbered = p
    Bulleted = p
    BulletedLast = p

Specify ancestry for each format

Designate the appropriate ancestors for each type of list element:

    [DITAParents]
    Numbered1 = ol li
    Numbered = ol li
    Bulleted = ul li
    BulletedLast = ul li

Make each format first in <li>

Make sure each list-item paragraph is first in its <li> element:

    [DITAFirst]
    Numbered1 = ol li
    Numbered = li
    Bulleted = li
    BulletedLast = li

Make sure each list ends where it should

If the last paragraph in a multi-paragraph list item is followed by a paragraph whose format is mapped to an element that is valid in <li>, that paragraph will be included in the list item. To prevent including the following paragraph, you can explicitly close the list:

    [DITACloseAfter]
    BulletedLast = ul li

Or insert a DITACloseAfter PI marker in the last list-item paragraph, with content ul li.

As an alternative, you can make sure the list closes before the following paragraph:

    [DITACloseBefore]
    Body = ul ol

Or insert a DITACloseBefore PI marker in the following paragraph, with content ul ol.

Previous Topic: 24.5.10.2 Starting a new hierarchy after the current block

Next Topic: 24.5.12 Specifying DITA element levels

Parent Topic: 24.5 Nesting DITA block elements

Sibling Topics:

24.5.1 Understanding how DITA2Go determines element nesting

24.5.2 Designating DITA ancestor elements

24.5.3 Fixing up interpolated ancestries

24.5.4 Deciding when to fully specify ancestry

24.5.5 Specifying alternate ancestries for the same element

24.5.6 Avoiding invalid ancestries

24.5.7 Specifying first-child status for nested elements

24.5.8 Configuring nested lists

24.5.9 Closing DITA ancestor elements

24.5.10 Opening DITA ancestor elements

24.5.12 Specifying DITA element levels

Table of Contents • Index