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 | 193 | 2 weeks ago | ||
| 0 | 111 | 2 weeks ago | ||
| 1 | 206 | 3 weeks ago | ||
| 1 | 324 | 3 weeks ago | ||
| 6 | 1523 | 3 weeks ago |