Are there alternatives for striptags filter? When printing a text field we just want to display the value. When printed as is in a twig template ({{ content.field_subtitle }}) we get the following output. 

Currently we are attempting not to use the |raw filter so we are just using {{ content.field_subtitle|render|striptags }}. 

Are there alternatives to this approach without having to create another twig template for the field? We are having a hard time finding an alternative. 

Setup:


Basic page content type has field field_subtitle where type is text(plain)
no twig template has been created on the field, only the content type node--page.html.twig


Current setup in twig template

&lt;div class="myclass__subtitle&gt;
  {{ content.field_subtitle|render|striptags }}
&lt;/div&gt;


Current output:

&lt;div class="myclass__subtitle"&gt;    
  &lt;div class="field field--name-field-subtitle field--type-string field--label-hidden field__item"&gt;Intrinsicly harness interactive functionalities.&lt;/div&gt;
&lt;/div&gt;


Desired output:

&lt;div class="myclass__subtitle"&gt;    
  Intrinsicly harness interactive functionalities
&lt;/div&gt;
I am vehemently against things like render-array|render|striptags etc. It feels very unnatural and un-Drupal. What you should do is create a field template that has no markup.

For example, either in field.html.twig which would affect all fields, or in field--field-name.html.twig or more specific variants, you can do this:

{#
/**
* @file
* Theme override to remove all field markup.
*/
#}

{% spaceless %}
{% for item in items %}
  {{ item.content }}
{% endfor %}
{% endspaceless %}


This will always render that field with no markup.