hofff / contao-social-tags

GNU Lesser General Public License v3.0
2 stars 5 forks source link

Strip tags for meta properties #21

Closed fritzmg closed 3 years ago

fritzmg commented 3 years ago

In the extractor classes replaceInsertTags is used for all fields. However, if you use

DAS {{br}}MODEL {{br}}UND SEIN {{br}}TÜFTLER

in a news headline for example (in order to force breaks at specific points), the resulting og:title for example will be

<meta prefix="og: http://ogp.me/ns#" property="og:title" content="DAS  &lt;br&gt;MODELL &lt;br&gt;UND SEIN  &lt;br&gt;TÜFTLER">

which will then look like this when sharing:

image

To fix this any HTML tags should be stripped for these HTML attributes.

dmolineus commented 3 years ago

Thanks @fritzmg