pedroborges / kirby-meta-tags

⬢ HTML meta tags generator for Kirby. Supports Open Graph and Twitter Cards out of the box.
MIT License
97 stars 11 forks source link

Each call to render bloats up with duplicate tags #22

Closed qwerdee closed 3 years ago

qwerdee commented 4 years ago

Calling render multiple times creates causes tags to be copied for each call.

So for example.

$meta = metaTags(page());
echo $meta->render(); //  => <title>test</title>
echo $meta->render(); //  => <title>test</title><title>test</title>
echo $meta->render(); //  => <title>test</title><title>test</title><title>test</title>

It does not matter if you pass the group argument to the function. It still copies all the tags with each call

Of course the render method should not modify the result like this and should not have side effects.