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 |
|---|---|---|---|---|
| 3 | 123 | 3 days ago | ||
| 0 | 65 | 6 days ago | ||
| 1 | 159 | 2 weeks ago | ||
| 1 | 274 | 2 weeks ago | ||
| 6 | 1461 | 2 weeks ago |