S
S
Sergey Beloventsev2018-04-17 14:30:49
Twig
Sergey Beloventsev, 2018-04-17 14:30:49

How to format text with html tags in Twig?

There is such a template in the following question

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>{{title}}</title>
</head>
<body>
    {{ content }}
</body>
</html>

the following text comes to content and accordingly on the page I get like this Hello World I would like the page to display<p>Hello World</p>
hello world
and the page source code was like this
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>{{title}}</title>
</head>
<body>
    <p>Hello World</p>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
datka, 2018-04-17
@Sergalas

If I get the gist of the question, try this:
{{ content |raw }}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question