Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
3.99k stars 612 forks source link

Adding custom class to image uploads #1066

Open cagtanir opened 4 years ago

cagtanir commented 4 years ago

Hi, first of all thanks a lot for this amazing plugin. Everything works as I want, especially with the customizable settings when loading the plugin. But the only issue I'm having with it is that you can't add a custom class to image uploads.

I only need custom classes on image uploads, specifically on the <p> element around it. As most of us are using Bootstrap or similar, being able to add classes like .text-center to the parent <p> element of the image or .img-responsive to the image itself would be very useful. I can't imagine it being too difficult to implement if you just get an additional parameter when calling the plugin and that can default to null.

I really hope this would be something you'd consider adding. Thanks again for this great plugin, you have no idea how much trouble you saved me from if I didn't come across this plugin :)

Have a good one!

cognitox commented 2 years ago

Just wondering if there is any update for this feature request yet?

Alex-D commented 2 years ago

Did you try this? https://alex-d.github.io/Trumbowyg/documentation/#tag-classes

shiva-kumar-sahoo commented 8 months ago

Did you try this? https://alex-d.github.io/Trumbowyg/documentation/#tag-classes

Yes i do, but the class is not applied in the img tag tagClasses: { img: 'img-fluid' }

vaibhav3027 commented 3 months ago

doesn't apply to p tags as well.