FrameworkJavaScript
Link tool: insert and edit inline links
Wraps selected text in `<a href="...">`. Activated with Cmd/Ctrl+K. Clicking the button on existing linked text opens the URL input allowing the link to be edited or removed.
Import
TypeScript
import { Link } from '@bloklabs/core/tools';Save Data
TypeScript
// Stored as HTML inside the block's text field.
// '<a href="https://example.com">Example</a>'JSON
{
"type": "paragraph",
"data": {
"text": "Visit <a href=\"https://example.com\">Example</a>"
}
}Usage Example
TypeScript
import { Blok } from '@bloklabs/core';
import { Link } from '@bloklabs/core/tools';
const editor = new Blok({
holder: 'editor',
tools: {
link: Link,
},
});