I'm getting the value of a wysiwyg field in a preprocessor then passing it to Twig in a #markup render array. Everything works as expected with the exception of embedded images. I've modified the list of XSS allowed tags to allow the drupal-entity tag. However, it seems that this is being passed to Twig after the EntityEmbedFilter has opened and closed.
I'd like to use EntityEmbedFilter process function to process the value of my field prior to passing it to Twig. However, when trying to instantiate an instance of EntityEmbedFilter with the new keyword, I get an an error because the constructor requires a configuration array.