parchment icon indicating copy to clipboard operation
parchment copied to clipboard

Adding a custom Blot

Open IvanFarkas opened this issue 2 years ago • 1 comments

Adding a custom Blot

The Example instructs

import Parchment from 'parchment';

class LinkBlot extends Parchment.Inline {

but Parchment.Inline does not exist, InlineBlot does from here as class InlineBlot extends ParentBlot implements Formattable

  • Is the Example documentation incorrect?
  • If it is, can it be corrected, please?
  • Would this be OK?
import { InlineBlot } from 'parchment';

class CustomInlineBlot extends InlineBlot {

Also, this does not work as in the example.

Parchment.register(LinkBlot);

Getting error

Property 'register' does not exist on type 'typeof import(".../node_modules/parchment/dist/typings/parchment")'

IvanFarkas avatar Jan 17 '23 23:01 IvanFarkas