Overview
The Link plugin provides comprehensive link management capabilities, including inserting, editing, and optimizing hyperlinks. Features include URL validation, preview, SEO metadata, tracking parameters, and accessibility enhancements.
Features
- â Easy link insertion
- â URL validation
- â Link preview
- â SEO meta tags
- â Tracking parameters
- â Link anchors
- â Accessibility attributes
- â Link analytics
Installation
npm install @editora/plugin-link
Basic Usage
import Editora from '@editora/core';
import LinkPlugin from '@editora/plugin-link';
const editor = new Editora('#editor');
editor.use(LinkPlugin);
// Select text and create link
editor.execCommand('createLink', 'https://example.com');
Link Management
Work with links efficiently:
- Create: Select text and add link via dialog or toolbar
- Edit: Double-click link to edit URL or properties
- Remove: Remove links while keeping text
- Properties: Add title, target, rel attributes
Configuration Options
| Option | Type | Description |
|---|---|---|
| validateUrl | boolean | Validate URLs before insertion (default: true) |
| openInNewTab | boolean | Default link target (default: false) |
API Methods
- createLink(url): Create link from selection
- removeLink(): Remove link from selection
- editLink(url): Edit selected link
- getLink(): Get current link properties