lietzsche;noether
Pages

updated 2026-11-26·1 min read

ProseMirror & Editor Bridge

Integrate custom ProseMirror decorations, shortcuts, and TipTap middleware into Noether's Live Preview editor with registerEditorPlugin().

Extensions in Noether can integrate directly into the TipTap 2.x and ProseMirror Live Preview editor engine using this.registerEditorPlugin().

1. Registering Editor Extensions & Middleware

this.registerEditorPlugin({
  id: 'custom-mention-decorator',
  decorations: (state, ctx) => {
    // Return custom mapped DecorationSet
    return null;
  },
  keyboardShortcuts: {
    'Mod-Alt-m': ({ editor }) => {
      editor.chain().focus().insertContent('@').run();
      return true;
    },
  },
});

2. Transaction Decoration Mapping

When creating custom editor decorations, avoid re-scanning the entire document on every keystroke. Noether maps existing decorations through ProseMirror transaction steps (mapping.map(decorations)), which updates active decorations rather than reparsing the whole note. Only the dirty range being edited needs to be inspected for new tokens, keeping the editor responsive even on long documents.

Search wiki and portfolio

type to search across all entries.