Hi,
We're trying to create a couple custom formats that require multiple attributes for them to be useful.
For instance, imagine we wanted to change the way the Image embed works to be able to specify a particular size (or alt text) at the time of creation. We can't do this with insertEmbed because the value argument is expected to be a string, and there is no attributes argument.
What would be the correct way of instantiating an embed that has associated attributes? Would I just generate my own Delta and use updateContents instead of doing insertEmbed?
Would love some guidance, thanks!
The value argument for insertEmbed can be any type. But the default Image blot understands its value to be a string. If you create your own blot or extend an existing one, you do not have to a use a string as the value.
For size specifically, the Image blot actually understands width and height: http://codepen.io/quill/pen/VmbKdm
@jhchen thanks for the confirmation on this. Makes total sense.
Most helpful comment
The value argument for insertEmbed can be any type. But the default Image blot understands its value to be a string. If you create your own blot or extend an existing one, you do not have to a use a string as the value.
For size specifically, the Image blot actually understands width and height: http://codepen.io/quill/pen/VmbKdm