mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 22:18:08 +08:00

Continues the work done on https://github.com/discourse/discourse/pull/30815. Adds a `footnote` node, parser, `^[inline]` input rule, toolbar button item, and serializer. Also adds a NodeView with an internal ProseMirror editor to edit the footnote content.
23 lines
567 B
JavaScript
23 lines
567 B
JavaScript
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
import { i18n } from "discourse-i18n";
|
|
import richEditorExtension from "../lib/rich-editor-extension";
|
|
|
|
export default {
|
|
name: "footnotes-composer",
|
|
|
|
initialize() {
|
|
withPluginApi((api) => {
|
|
api.registerRichEditorExtension(richEditorExtension);
|
|
|
|
api.addComposerToolbarPopupMenuOption({
|
|
action(event) {
|
|
event.addText(`^[${i18n("footnote.title")}]`);
|
|
},
|
|
group: "insertions",
|
|
icon: "asterisk",
|
|
label: "footnote.add",
|
|
});
|
|
});
|
|
},
|
|
};
|