Track Changes Plugin
Toggleable review mode: typed text is marked as insertion, backspace soft-deletes with a deletion mark.
- Toolbar button toggles the mode (Review menu)
- Inserts render with a green highlight (
.tracked-insert) - Soft-deleted text stays in the document with strikethrough (
.tracked-delete) until hard-deleted
Installation
bash
npm install on-codemergeBasic Usage
javascript
import { Editor, TrackChangesPlugin } from 'on-codemerge';
import 'on-codemerge/index.css';
import 'on-codemerge/public.css';
const editor = new Editor(container, {
plugins: [TrackChangesPlugin()],
});How It Works
- Toggle Track Changes in the Review menu
- Type — new characters get an
insertionmark via editor stored marks - Backspace — characters get a
deletionmark (strikethrough); backspace again on marked text removes it