Q:

How to display plain text only from redactor without any line break or format

Is there a way to display plain text only without any line break or format style. I have an input field using the redactor. I want the result to shows plain text without any formatting for this particular page. How can I modify it?
{% set desc = desc|slice(0,150) %}
{% set _desc = desc|split(' ') %}
{% set __desc = _desc|slice(0,-1) %}
{% set desc = __desc|join(' ') %}
{{desc|raw}}

Thanks.

A:

If you're trying to remove HTML tags from the output completely, you can use Twig's striptags filter: https://twig.symfony.com/doc/2.x/filters/striptags.html.
If you want to retain the tags but show the output without any styling, you're going to have to handle that with your CSS by negating any of the existing styling you don't want.

