Twig: how to check the inner html content of a field
问题 i have a single field and that field can have one or two lines of html: <p>One line</p> or: <p>first line</p> <p>Second line </p> Using twig how can i check if the field has one or two tags. Example of what i want to do: {% if item|length('<p>') = 1 %} <div class="one">{{ item }}</div> {% elseif item|length('<p>') = 2 %} <div class="two">{{ item }}</div> {% endif %} Any ideas of how to accomplish this? Update #1: What Honza said is true I want the parent div to have a class if there is only