JSPM

tiptap-extension-image-link

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53
  • Score
    100M100P100Q51359F
  • License ISC

An extension that supports tiptap image link.

Package Exports

  • tiptap-extension-image-link
  • tiptap-extension-image-link/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tiptap-extension-image-link) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tiptap-extension-image-link

An extension that supports tiptap image link.


NPM URL version



Install

npm install tiptap-extension-image-link -S

Usage

Insert an image link with the setImageLink command.

editor
  .chain()
  .focus()
  .setImageLink({
    href: "This is the link url",
    src: "This is the image url",
    HTMLAttributes: {
      class: "image_link",
      "data-nickname": Name,
      "data-appid": AppID,
      "data-path": Path,
      "data-type": "image",
      "data-servicetype": "",
      target: "",
    },
  })
  .enter()
  .run();

Options

You can configure common image link HTML attributes via the HTMLAttributes options

import ImageLink from "tiptap-extension-image-link";

const editor = new Editor({
  element: document.querySelector(".editor"),
  extensions: [
    StarterKit,
    ImageLink.configure({
      HTMLAttributes: {
        class: "image-link",
      },
    }),
  ],
});

Relations

@tiptap/extension-link: https://github.com/ueberdosis/tiptap/tree/develop/packages/extension-link

tiptap-extension-link: https://github.com/KID-1912/tiptap-extension-link

tiptap-appmsg-editor: https://github.com/KID-1912/tiptap-appmsg-editor