Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support setting
img[alt]
on ManagedAttachment
Extend the `PreviewableAttachmentView` to assign [HTMLImageElement.alt][] based on the `Attachment` instance's `"alt"` attribute. This enables applications to set the [preview image's alt text][4.8.4.4] while editing inside the `<trix-editor>` element. For example, an application can modify a `ManagedAttachment` instance through a `trix-attachment-add` event listener: ```js addEventListener("trix-attachment-add", ({ attachment }) => { attachment.setAttributes({ alt: `Attached file ${attachment.file.name}` }) }) ``` [HTMLImageElement.alt]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt [4.8.4.4]: https://html.spec.whatwg.org/multipage/images.html#alt
- Loading branch information