This can cause it to generate for example the following invalid HTML:
<p> Misschien heeft u gezien dat wij spanningsgestuurde en <a...</p>
As you can see, it generated an unclosed tag, i.e. <a in this example. To prevent this, you can call strip_tags first and afterwards call truncate, like the following:
Niara seems to do something like the following on various places:
https://github.com/thirtybees/niara/blob/eddb7661e611f9f4f494449eec0cea134c0c884d/modules/beesblogrecentposts/views/templates/hooks/home.tpl#L49
This can cause it to generate for example the following invalid HTML:
As you can see, it generated an unclosed tag, i.e.
<a
in this example. To prevent this, you can callstrip_tags
first and afterwards calltruncate
, like the following: