Class: Lists

Lists(chunker, polisher, caller)

Handles ordered list (<ol>) processing across paginated content. Extends the base Handler class to manage list item numbering before and after pagination.

Constructor

new Lists(chunker, polisher, caller)

Constructs a Lists handler.

Constructs a Lists handler.

Parameters:
Name Type Description
chunker Object

The chunker instance used for splitting content into pages.

polisher Object

The polisher instance for style processing.

caller Object

The caller instance managing lifecycle hooks.

Source:

Methods

addDataNumbers(list)

Adds data-item-num attributes to each <li> in an ordered list.

Adds data-item-num attributes to each <li> in an ordered list. This helps track correct numbering even when the list spans multiple pages.

Parameters:
Name Type Description
list HTMLOListElement

The ordered list to process.

Source:

afterPageLayout(pageElement, page, breakToken, chunker)

Hook called after a page is laid out.

Hook called after a page is laid out. Updates the start attribute of <ol> elements to ensure numbering continuity across pages.

Parameters:
Name Type Description
pageElement HTMLElement

The DOM element for the current page.

page Object

The page object with metadata.

breakToken Object | null

The break token representing where content broke across pages.

chunker Object

The chunker instance.

Source:

afterParsed(content)

Hook called after the entire content is parsed but before layout.

Hook called after the entire content is parsed but before layout. Adds data-item-num attributes to <li> elements in ordered lists for later processing.

Parameters:
Name Type Description
content Document | HTMLElement

The parsed document or element.

Source: