What I'd like to do seems simple: I'd like to provide the users with an additional button on the standard Quill toolbar that allows the user to select the name of an image from a list and then add a an img-tag with the selected image as text at the position of the cursor. It is strictly browser-only, so no npm here. Maybe some REST to fetch the image list, but that's not the issue. I found several example on the quilljs site and here at StackOverflow, but none of them gave me the necessary clues to pull this one off.
Is there a good example somewhere, or can you guide me to where I can find the info I'm looking for? How to add one button to the already existing ones? How to present a list of names using Quill, if that can be accomplished using Quill? How to add text where the cursor is at?
TIA
What I'd like to do seems simple: I'd like to provide the users with an additional button on the standard Quill toolbar that allows the user to select the name of an image from a list and then add a an img-tag with the selected image as text at the position of the cursor. It is strictly browser-only, so no npm here. Maybe some REST to fetch the image list, but that's not the issue. I found several example on the quilljs.com site and here at StackOverflow, but none of them gave me the necessary clues to pull this one off.
Is there a good example somewhere, or can you guide me to where I can find the info I'm looking for? How to add one button to the already existing ones? How to present a list of names using Quill, if that can be accomplished using Quill? How to add text where the cursor is at?
TIA
I found the necessary clues here: https://anvil.works/forum/t/adding-a-new-quill-format/9602
The blotname should correspond with the name of the feature being added to the toolbar, which can be added to the array in toolbarOptions. The clickable button can be found using document.querySelector("button.ql-blotname").