How to set data per paragraph on Quill.js?


April 2019


37 time


I'm currently trying to trigger an event for each paragraph in a text-box which is controlled by Quill.js. However, every time I create a new paragraph, the data on the attributes is transferred to the new paragraph. Is there a way to conserve paragraph data without it being duplicated?

I tried setting a custom key element to the Blot representing the paragraph, but that data is lost when Blots are merged (for instance when you delete a paragraph right after another one). In the merging, I assume non-default keys are not copied between block Blots.

I'm wondering if there is a way to have unique data per paragraph, which is conserved when merging with other paragraphs.

Thanks in advance!

0 answers