The Footnote block is a simple example that we’ll use as the basis of later blocks with more advanced features.
The Footnote block displays multiline content as multiple paragraph (
<p>) elements wrapped within a
- The block has only one attribute,
content, which will store the input.
edit()function renders the
RichTextcomponent as an editable field. It also specifies how the input will be displayed in the editor and how changes will be handled; in this case, changes to the input will update the value of the
save()function takes the
RichTextcontent, assembles the HTML, and adds it to the post content that will be saved in the database.