Closed netwaretcs closed 1 month ago
What do you mean by In some cases, titles and descriptions are taken directly from markdown fields.
? Can you give me an example how to reproduce this?
In articles collection we use "markdown" for the title field.
So if the title is:
This is a **Title**
The tag
<title><p>This is a <strong>title</strong</p></title>
Same thing for description, og:title...
I can't reproduce this issue. Using the strip_tags
modifier in the title field works for me.
Generally, I think it is a good idea to strip tags and any other unsupported characters like line breaks and such from meta fields. But I'd rather implement it on a deeper level, so it also works with GraphQL.
For now, you should be able to publish the views of this addon to implement the solution as per this PR. But I'm curious as to why the strip_tags
modifier didn't work for you in the first place?
I will try to debug the problem so that I can give you more details.
Is this still an issue for you?
I'm closing this PR as it appears inactive. Feel free to comment if you still think it is needed.
In some cases, titles and descriptions are taken directly from markdown fields. In my case, for example, I had the problem of p and strong tags being written in the meta title and meta description. I tried putting in the defaults {{ title | strip_tags }} but it didn't seem to work, so I thought I would come up with this pull request.