slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.52k stars 3.38k forks source link

v2.0.0-rc3: Uses a classname pattern to represent formats cannot defined in parchment #4029

Closed shun2wang closed 7 months ago

shun2wang commented 7 months ago

Hi, thanks for your work! Start from Quill2 seems Uses a class attributor pattern to represent formats not works anymore? I'm not sure it's issue of Quill or parchment so I file it here.

Steps for Reproduction

  1. Visit [quilljs.com and use quill v2.0.0-rc3 and also v1.3.7

2.In quill 1.3.7

import Parchment from 'parchment';

let Align = new Parchment.Attributor.Class('align', 'blot-align');

defined works.

  1. In quill 2-rc3, above code will get error:
    Uncaught TypeError: Parchment.Attributor.Class is not a constructor

I cannot find changes in docs in quill2 or parchment, am I missing something? but I can I use

let foo = new Parchment.ClassAttributor(...)

Expected behavior:

Should defined success or have some docs update.

Actual behavior:

Get error

Platforms: Chrome 121 on Windows 11.

Version:

Quill-2.0.0-rc3

luin commented 7 months ago

Thanks for reporting this! It was left out in the migration guide and now just got added: https://quilljs.com/guides/upgrading-to-2-0#parchment.

shun2wang commented 7 months ago

Thanks! and should also update the readme of https://github.com/quilljs/parchment?tab=readme-ov-file#attributor maybe?

luin commented 7 months ago

Sure thing! Updated!