I've created a custom text format I'm trying to apply to a field programmatically. As best I can tell, the format IS getting applied, but it is not stripping HTML tags like it is supposed to. The below screenshot shows how my text formatter is configured:
As you can see, its supposed to filter <span>
tags. The Nodes where this will be used get created programmatically, and I apply the text formatter as follows:
'field_career_job_description1' => ['value' => $job['jobdesc'],'format' => 'careers_html_formatter']
This appears to be working correctly, if I print the variables passed to twig, I see that the formatter is, indeed, my custom format:
However, as you can see in the sshot, <span>
tags are still in the text.
Note that I am displaying the field in question in Twig as follows:
{{ content.field_career_job_description1[0]['#text'] | raw }}