Events seems to do a little more, including privilege checks and so on, so it might be hard to get these done before Quill generates the toolbar, but it does so quite early, which is why canned responses needed to require the formatting lib earlier and then hook into the composer.enhanced event.
Latest quill and composer now also supports insertIntoTextarea and updateTextareaSelection, though it looks like you need logic to find and replace existing text? Maybe I can add that in as a method into composer-default's controls.js as well.
This is how canned-responses integrates with Quill: https://github.com/julianlam/nodebb-plugin-canned-responses/commit/070cdfdda9bc7972f8a759c2869a0634f20339a2
Events seems to do a little more, including privilege checks and so on, so it might be hard to get these done before Quill generates the toolbar, but it does so quite early, which is why canned responses needed to require the formatting lib earlier and then hook into the
composer.enhanced
event.Latest quill and composer now also supports
insertIntoTextarea
andupdateTextareaSelection
, though it looks like you need logic to find and replace existing text? Maybe I can add that in as a method into composer-default'scontrols.js
as well.