I would like to add a button to Trix editor that would insert YouTube video using custom HTML attribute. It seems to me that default link
button is exactly what I need. I would need to just modify little bit what is done once someone click the link button after text is entered.
The standard link button
- has Trix menu button
- has input field
- has input value validation
- link and unlink functionality. I might want to remove the
unlink
button - inserts text into editor
I was searching the net but did not find any example how to achieve what I want. The closest solution is https://www.kindleman.com.au/blog/advanced-actiontext-modifications-for-cms-use/ the embed, image, and link buttons are basically what I want. But it is coded in RoR. I know nothing about RoR.
Could someone help me to create my link (embed) button in Trix?