I have just added a new Twig filter that give me HTML from a Textile Markup; so I return it raw.
It's embedded into a html paragraph and the .twig file look like this:
[..]
<p class="description">
{{ description|textile|raw }}
</p>
[..]
Description variable contains another paragraph:
Some text
But the rendered content is this instead:
<p class="description"></p>
<p>
Some text
</p>
and the variable is rendered outside of the container, with no apparent reason.
If I change the container to it works perfectly
<div class="description">
<p>
Some text
</p>
</div>
Someone can give me some reason?
That's normal, because <p>
elements are not allowed inside other <p>
elements.
Technically, the content model of <p>
elements is phrasing content, which doesn't include other <p>
elements.
You can validate your markup in http://validator.w3.org/