Hi all. Just a quick question. I've got a summary based on the Redwood theme where I truncate text and put an ellipsis afterwards. Client can fill in using Bard field type so they can set text in bold and italic. Now there is (not always) a
in their text. I want that stripped out, but it seems it is not working... :(

I tried several options, and when using {{ summary | strip_tags:true }} in the template all stripping is done OK, but when using {{ summary | strip_tags:em|strong|br }} only the first tag is stripped, not the other two. Using {{ summary | macro:summary }} and defining it in the macro.yaml works the same: so it is basically an all or nothing setting...

data:

title: Effe snel wat in elkaar geflanst
summary: '<p>Dido Dido is na een <em>succesvolle</em> tournee door Nederland nog <strong>eenmalig</strong> te zien tijdens de Operadagen Rotterdam op 25 mei<br></p>'

fieldset:

summary:
    type: bard
    display: Summary
    instructions: 'Has a twofold purpose: acts as the introduction paragraph while being the summary in the news carousel on the homepage. Keep it short & sweet.'
    localizable: true
    spellcheck: true
    style: serif
    semantic_elements: true
    buttons:
      - bold
      - italic

template:

<div class="summary">
    <h3>{{ title }}</h3>
    <p>{{ summary | macro:summary }}</p>
</div>

macro:

summary:
  strip_tags: em|strong|br
  safe_truncate: 100
  ensure_right: ...

looks very solid to me :smiley:

Answered by Peter Emil van den Berg! Go to answer.