Problem with file.html()|raw (how not to have a paragraph <p> ?)

In a twig file, I use {{file.html()|raw}} and I obtain something like <p alt="">mytext</p>.
Is it possible to obtain only the text mytext ?

Try striptags

{{file.html()|raw|striptags}}
1 Like