Skip to content
Document Authoring DA  API Docs v1.10.0
npmGitHub

Endnote

Endnote:

{
type: "endnote";
}

Represents an endnote element within document content.

Endnote is an inline element that contains an endnote reference mark in the main text and associated content that appears at the end of the document or section. Endnotes are similar to footnotes but collected at the end rather than at the bottom of each page.

The endnote contains block-level content (paragraphs, tables) accessed via the content() method. Endnotes are discovered by iterating through inline elements and checking their type discriminator.

Find and list all endnotes:

const inlines = textView.inlines();
for (const rangeInline of inlines) {
if (rangeInline.inline.type === 'endnote') {
const endnoteContent = rangeInline.inline.content();
const text = endnoteContent.blocklevels()
.map(bl => bl.type === 'paragraph' ? bl.asTextView().getPlainText() : '')
.join(' ');
console.log('Endnote text:', text);
}
}

type: "endnote"

Type discriminator for inline elements.

Always has the value 'endnote'. Use this property to narrow the inline element type and access endnote-specific methods.

content(): BlockLevelContainer

Gets the block-level content container for this endnote.

BlockLevelContainer

A BlockLevelContainer containing the endnote’s paragraphs and tables

Returns a container that holds the actual content of the endnote (what appears at the end of the document or section). You can use this to read, modify, add, or remove content within the endnote using the standard BlockLevelContainer methods.

if (inline.type === 'endnote') {
const content = inline.content();
const paragraphs = content.blocklevels();
console.log(`Endnote has ${paragraphs.length} paragraphs`);
}