witech You should be able to make a small extension rather than edit files but it would have to run after this one. I believe that Illuminate\Events\Dispatcher::listen()
has a third optional parameter that sets the priority. Subscribe to the ConfigureFormatter
event and you'll have the original template in $event->configurator->tags['YOUTUBE']->template
. It's an object that you can read/write as a string.
If you want to manipulate the template as a DOM, grep Flarum's source for configureExternalLinks
and it'll give you an example.