##### 24.5.9.1 Ending ancestor elements before the current block

In some cases, it is not clear whether a paragraph is supposed to be a child of the preceding element (or nest of elements). For example, by default a <p> element following a list item becomes part of the <li>, and that is not necessarily what you want.

To close an element (or a hierarchy of elements) before starting the current block (for example):

    [DITACloseBefore]
    ; para format = elements to be closed, with any other elements
    ;   nested under them, before the current block element starts.
    Recap = li
    Body = ul ol

Use this setting to force closure of elements that were opened based on settings in [DITAParents]; see §24.5.2 Designating DITA ancestor elements. You can list as many possible ancestors as necessary; order is not important.

For individual cases, you can insert a DITACloseBefore PI marker in the paragraph for the current block element instead, with content the name(s) of the element(s) to close. You can also use a DITACloseBefore PI marker to override a [DITACloseBefore] setting when you want to close a higher (or lower) ancestor than the setting specifies.

Previous Topic: 24.5.9 Closing DITA ancestor elements

Next Topic: 24.5.9.2 Ending ancestor elements after the current block

Parent Topic: 24.5.9 Closing DITA ancestor elements

Sibling Topics:

24.5.9.2 Ending ancestor elements after the current block

Table of Contents • Index