Anchor Link Plugin
Insert anchors and links to sections (auto-generate ID from selection if empty).
- The
#button opens a popup with Anchor ID and Text - Inserts an
.anchor-linkat the current cursor position
Installation
bash
npm install on-codemergeBasic Usage
javascript
import { Editor, AnchorLinkPlugin } from 'on-codemerge';
import 'on-codemerge/index.css';
import 'on-codemerge/public.css';
const editor = new Editor(container, {
plugins: [AnchorLinkPlugin()],
});How It Works
- Select a phrase in the document
- Click
#in the toolbar → fill Anchor ID and Text → Insert