Skip to content

Adding a custom Blot #122

@IvanFarkas

Description

@IvanFarkas

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")'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions