Open haleyngonadi opened 11 months ago
According to MDN the 'align' attribute has been deprecated for images. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#align
I recommend inserting the image then using the alignment tools from the toolbar.
Hi @awcodes, I wasn't trying to use the align attribute per se; I just wanted to be able to add a custom class to the image. Is that something that can be done?
Ah. ok. i'll reopen then.
Many time after this, I'm back. I don't want to open a new issue, as it's the same subject.
It'd be great to be able to add more params. For example, srcset or sizes (as I'm trying to do) I can make the PHP part for it, but as soon as it gets to plugins.js, it removes all attributes not in this list:
filament-tiptap-editor/resources/js/plugin.js:465
.setImage({
src: src,
alt: media?.alt,
title: media?.title,
width: media?.width,
height: media?.height,
lazy: media?.lazy,
})
Here there's a list of all possible attributes: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes
and of course, some global attributes as:
and some event handlers:
Adding all those to plugin.js
would help us to make any plugin with ease.
I'm open to PRs. Haven't forgotten about the original issue. Just haven't had the time. Sorry.
The plugin is awesome. Let me first of all thank you for it.
I've already made a PR with those properties needed for responsive images coming from spatie/laravel-medialibrary
I'll look at the PR when I get a chance. Thank you.
Filament Version
v3.0.97
Plugin Version
v3.2.6
PHP Version
PHP 8.2
Problem description
Following up on this discussion: I'm trying to extend the existing MediaAction to allow for an "align" attribute.
Here's my custom MediaAction (which doesn't work)
Expected behavior
When you insert an image, the "align" attribute should be added to the img tag, like so tag.
Steps to reproduce
N/A
Reproduction repository
No response
Relevant log output
No response