---
title: "Footnotes and endnotes"
canonical_url: "https://www.nutrient.io/guides/document-authoring/editing-content/footnotes-and-endnotes/"
md_url: "https://www.nutrient.io/guides/document-authoring/editing-content/footnotes-and-endnotes.md"
last_updated: "2026-07-08T00:00:00.000Z"
description: "Find and edit footnotes and endnotes in Document Authoring by locating inline markers in a paragraph and updating the note content through its block-level container."
---

# Work with footnotes and endnotes

A footnote or endnote appears in the text as an inline marker. Its content appears at the bottom of the page or the end of the document, and Document Authoring stores that content in a block-level container on the marker.

Inside a [transaction](https://www.nutrient.io/guides/document-authoring/editing-content/programmatic-editing.md), find markers through a paragraph’s [`inlines()`](https://www.nutrient.io/api/document-authoring/types/programmatic/textview/#inlines) method. Then read or update the marker content.

Footnotes and endnotes work like [images and shapes](https://www.nutrient.io/guides/document-authoring/editing-content/images-and-shapes.md) and [headers and footers](https://www.nutrient.io/guides/document-authoring/page-layout/headers-and-footers.md): They’re existing document containers. The programmatic API reads and edits their content, but it doesn’t create new footnotes or endnotes.

Before you start, make sure the Document Authoring library is installed and running in your app. If you haven’t set it up yet, refer to the [getting started](https://www.nutrient.io/sdk/document-authoring/getting-started.md) guide.

The examples omit error handling. Add it before you use this code in production.

## Read a footnote

Match inline elements whose `type` is `footnote`. Then read the note content from its [`BlockLevelContainer`](https://www.nutrient.io/api/document-authoring/types/programmatic/blocklevelcontainer/). The content stores text in paragraphs:

```js

const currentDoc = editor.currentDocument();

await currentDoc.transaction(async ({ draft }) => {
  for (const blockLevel of draft.body().content().blocklevels()) {
    if (blockLevel.type!== 'paragraph') continue;

    for (const { inline } of blockLevel.asTextView().inlines()) {
      if (inline.type!== 'footnote') continue;

      const text = inline.content().blocklevels().map((block) => (block.type === 'paragraph'? block.asTextView().getPlainText() : '')).join('\n');

      console.log(`Footnote: ${text}`);
    }
  }

  return false;
});

```

## Edit a footnote

The note content is a block-level container, so you can change its text the same way you change a paragraph. Set the text on the existing first paragraph:

```js

await currentDoc.transaction(async ({ draft }) => {
  for (const blockLevel of draft.body().content().blocklevels()) {
    if (blockLevel.type!== 'paragraph') continue;

    for (const { inline } of blockLevel.asTextView().inlines()) {
      if (inline.type!== 'footnote') continue;

      const [firstBlock] = inline.content().blocklevels();
      if (firstBlock && firstBlock.type === 'paragraph') {
        firstBlock.asTextView().setText('See the appendix for details.');
      }
    }
  }

  return true;
});

```

## Work with endnotes

Endnotes work the same way as footnotes. Match `inline.type === 'endnote'`, and use the same [`content()`](https://www.nutrient.io/api/document-authoring/types/programmatic/endnote/#content) container to read or edit the note.

A note’s content can also include reference markers. These inline elements use the `footnote/ref` and `endnote/ref` types, and they link back to where the note is cited. Skip them unless your integration needs to handle those back-references.

## Learn more

**[Text and formatting](https://www.nutrient.io/guides/document-authoring/editing-content/text-and-formatting.md)**\
Format text inside a note.

**[Programmatic editing](https://www.nutrient.io/guides/document-authoring/editing-content/programmatic-editing.md)**\
Learn how transactions work and how to use the document model.
---

## Related pages

- [Use copy/paste and HTML interoperability](/guides/document-authoring/editing-content/copy-paste-and-html-interoperability.md)
- [Work with lists](/guides/document-authoring/editing-content/lists.md)
- [Find and replace text](/guides/document-authoring/editing-content/find-and-replace.md)
- [Edit documents programmatically](/guides/document-authoring/editing-content/programmatic-editing.md)
- [Work with images and shapes](/guides/document-authoring/editing-content/images-and-shapes.md)
- [Format text](/guides/document-authoring/editing-content/text-and-formatting.md)
- [Work with tables](/guides/document-authoring/editing-content/tables.md)

