To address the issue with the meta tag generated by @Html.Kentico().PageDescription() helper in Kentico, the challenge lies in the HTML validation warning about the trailing slash on void elements (like tags). Currently, this helper method seems to automatically include a closing slash, which is not necessary and triggers the validation message.
Here is a approach you could consider to resolve this:
Custom Helper Method:
Instead of using @Html.Kentico().PageDescription(), create a custom helper method or directly output the meta tag using Razor syntax without the helper. Here’s an example of how you can achieve this:
In this approach, you would set ViewBag.PageDescription in your controller or view model, ensuring it contains the correct description content dynamically.