striptags but leave link test in between I have a rich text (redactor field) that I'm using striptags on to remove the html markup from the front end. However I noticed for links it whips out the link and the text in between. Is this something I can fix with a regular expression? Can you even do that with a twig filter? If so does anyone have an example?

Here is my code: 

{% set articleText = myFirstMatrixBlockWithType.blogArticleText %}
{% if articleText | length &gt; 200 %}
    {% set articleTextTrim = articleText | slice(0, 200) ~ '...' %}
    {{ articleTextTrim | striptags }}
{% else %}
    {{ articleText | striptags }} 
{% endif %}
Actually, excluding certain tags from being removed is built into the striptags filter.

You can use it like this:

{{ articleTextTrim | striptags('&lt;a&gt;') }}