Footnote
Footnote:
{}Represents a footnote element within document content.
Remarks
Section titled “Remarks”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.
Examples
Section titled “Examples”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`); }}Properties
Section titled “Properties”type:
"footnote"
Type discriminator for inline elements.
Remarks
Section titled “Remarks”Always has the value 'footnote'. Use this property to narrow the inline element
type and access footnote-specific methods.
Methods
Section titled “Methods”content()
Section titled “content()”content():
BlockLevelContainer
Gets the block-level content container for this footnote.
Returns
Section titled “Returns”A BlockLevelContainer containing the footnote’s paragraphs and tables
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”if (inline.type === 'footnote') { const content = inline.content(); const paragraphs = content.blocklevels(); console.log(`Footnote has ${paragraphs.length} paragraphs`);}