Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a custom Blot #122

Open
IvanFarkas opened this issue Jan 17, 2023 · 1 comment
Open

Adding a custom Blot #122

IvanFarkas opened this issue Jan 17, 2023 · 1 comment

Comments

@IvanFarkas
Copy link

IvanFarkas commented Jan 17, 2023

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")'
@64jcl
Copy link

64jcl commented Apr 4, 2023

Was not able to get the example to work either where it extends Parchment.Inline. Only way I got custom blots to work was to extend Parchment.Embed. But perhaps my problem is something else. Also need to register this using Quill.register - Parchment.register does nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants