Getting to know QuillJS - Part 1 (Parchment, Blots, and Lifecycle)

  • Parchment will skip calling create() and use the passed DOM Node, skipping to the next step.
  • While you might know the blotName when manually instantiating a Blot, there are instances where Quill needs to create a Blot from DOM Node, such as copy/pasting.
  • Currently the only other way for Parchment to tell the difference between these HTML structures is by setting a static className that matches an expected CSS class on the DOM Node passed in.
  • This means parent ShadowBlot will automatically apply the className to the element's DOM Node in the static create() function, and that Parchment will be able to differentiate between the 2 Blots.
  • The ScrollBlot tracks the MutationRecords and calls the update() method on every Blot who's DOM Node was the target of a MutationRecord.
  • A Blot's update method is called with the MutationRecords targetting its DOM Node.

save | report | share on

Top 200 comments