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

Footnote

Footnote:

{
type: "footnote";
}

Represents a footnote element within document content.

Footnote is an inline element that contains a footnote reference mark in the main text and associated content that appears at the bottom of the page. The footnote itself contains block-level content (paragraphs, tables) accessed via the content() method.

Footnotes are discovered by iterating through inline elements and checking their type discriminator. Once you have a Footnote object, you can access and modify its content using the BlockLevelContainer interface.

Find and list all footnotes:

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

Search and replace within footnote content:

for (const rangeInline of textView.inlines()) {
if (rangeInline.inline.type === 'footnote') {
const footnoteContent = rangeInline.inline.content();
// Replace text in all footnote content
const count = footnoteContent.replaceText(/TODO/g, 'DONE');
console.log(`Replaced ${count} occurrences in footnote`);
}
}

type: "footnote"

Type discriminator for inline elements.

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

content(): BlockLevelContainer

Gets the block-level content container for this footnote.

BlockLevelContainer

A BlockLevelContainer containing the footnote’s paragraphs and tables

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

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