Extensions
footnote
The note itself: blocks, under the id its marker carries.
1 · Install
One package for every extension · there is no @matrajs/footnote 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, footnote } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, footnote],
element: document.querySelector('#editor'),
})3 · Use it
Nothing to call · this one works once it is in the array. The note itself: blocks, under the id its marker carries.
In the document
| Attribute | Default |
|---|---|
id | none |
-
Reads
li[data-footnote]when HTML is pasted or loaded. -
Writes
liingetHTML()andrenderToHTML().