Extensions
footnoteRef
The marker in the text.
It carries an id and nothing else. Its number is a decoration computed from where it stands, so moving a paragraph renumbers every note without a single change to the document, and two people looking at the same document see the same numbers. The element is empty in HTML; the number is drawn by `footnotesCSS` from the decoration's attribute.
1 · Install
One package for every extension · there is no @matrajs/footnoteRef to install.
npm i @matrajs/core2 · Add it to the editor
Import it and put it in the extensions array. That array is the whole feature list:
what is not in it is not in your bundle and not in the document's schema.
import { createEditor, document, paragraph, text, footnoteRef } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, footnoteRef],
element: document.querySelector('#editor'),
})3 · Use it
Nothing to call · this one works once it is in the array. The marker in the text.
In the document
| Attribute | Default |
|---|---|
id | none |
-
Reads
sup[data-footnote-ref]when HTML is pasted or loaded. -
Writes
supingetHTML()andrenderToHTML().