Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-link

Package Overview
Dependencies
Maintainers
2
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-link

link extension for tiptap

  • 2.0.0-beta.32
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
629K
decreased by-21.11%
Maintainers
2
Weekly downloads
 
Created

What is @tiptap/extension-link?

@tiptap/extension-link is an extension for the Tiptap rich-text editor that allows users to add, edit, and manage hyperlinks within their content. It provides a set of tools and configurations to handle links effectively, making it easier to integrate link functionalities into your Tiptap editor setup.

What are @tiptap/extension-link's main functionalities?

Add a Link

This feature allows you to add a link to your content. The code sample demonstrates how to configure the Link extension and initialize the editor with a link in the content.

import { Link } from '@tiptap/extension-link';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    Link.configure({
      openOnClick: false,
    }),
  ],
  content: '<p>Click <a href="https://example.com">here</a> to visit example.com</p>',
});

Edit a Link

This feature allows you to edit an existing link. The code sample shows how to change the href attribute of a link using Tiptap's chainable commands.

editor.chain().focus().extendMarkRange('link').setLink({ href: 'https://new-url.com' }).run();

Remove a Link

This feature allows you to remove a link from the content. The code sample demonstrates how to use the unsetLink command to remove a link.

editor.chain().focus().unsetLink().run();

Open Link on Click

This feature allows links to be opened when clicked. The code sample shows how to configure the Link extension to open links on click.

import { Link } from '@tiptap/extension-link';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    Link.configure({
      openOnClick: true,
    }),
  ],
  content: '<p>Click <a href="https://example.com">here</a> to visit example.com</p>',
});

Other packages similar to @tiptap/extension-link

Keywords

FAQs

Package last updated on 03 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc