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 ?
Solved by Karmalakas View solution
Try striptags
TWIG
{{file.html()|raw|striptags}}
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 4 | 479 | 3 weeks ago | ||
| 1 | 805 | 3 weeks ago | ||
| 3 | 664 | 2 months ago | ||
| 5 | 684 | 2 months ago | ||
| 1 | 645 | 3 months ago |