I'm investigating the use of Quill for a project, and I need to know if it's possible to create a custom format/blot with more complexity than a single element and a single parameter.
An example of one of the layouts I want would be:
<span class="format-container">
<span class="format-info" data-attr="param 1 (non-displayed)">
param 2 (displayed to user -- click to invoke application UI to edit)
</span>
<span class="format-content">
User's text/child elements go here
</span>
</span>
In all cases I'm looking into, the custom formats are of inline scope and still have a single parent container and a single place for the child content to go.
Custom formats in Quill don't seem to be very well documented at the moment. I poked around in the sources and was able to figure out that this most likely isn't possible in 0.20.1. However, I feel like it could be doable in the 1.0.0 beta w/ Parchment, I'm just not sure on the specifics of what I'd actually need to write.
So is this possible in 1.0.0? If so, how could it be done?
EDIT: This is what I'm going for:
Documentation and guides are still being written but a good place to look is how existing custom formats are implemented. The formula format in particular seems very similar to your use case.
So, I figured out how to do this in the end with minimal effort. It involves defining a new blot type for Quill 1.3 or greater, the same code should work on older versions however is untested.
See the code snippet for a working example. The crux is to extend the existing Embed blot 'blots/embed' and define your own toolbar handler to inject arbitrary DOM node instances.