Closed richardpeng closed 6 years ago
I'm creating an image with the following code, but the generated image doesn't include the data-image-id attribute.
data-image-id
image.url, image.size, { 'data-image-id': image.id, 'data-ce-max-width': image.size[0] });
I've tried adding data-image-id to the RESTRICTED_ATTRIBUTES like this but it didn't help:
RESTRICTED_ATTRIBUTES
ContentTools.RESTRICTED_ATTRIBUTES['img'].push('data-image-id')
How do I add additional attributes to a tag?
Hi @richardpeng any chance you can provide me with a full example, from the code above I can't see how you're creating an image? is this in the image handler or are you initializing the Image element class?
I'm creating an image with the following code, but the generated image doesn't include the
data-image-id
attribute.I've tried adding
data-image-id
to theRESTRICTED_ATTRIBUTES
like this but it didn't help:ContentTools.RESTRICTED_ATTRIBUTES['img'].push('data-image-id')
How do I add additional attributes to a tag?