The answer to the question is Yes, you should remove the superfluous solidus. (aka trailing slash, if you wish).
This is also true of HTML5. HTML does not require the slash before the closing > character (aka. "self-closing" tags, also a misnomer), such as <link />
, and <meta />
, <br />
, <hr />
, etc, and such use is is discouraged for multiple reasons as discussed at the target of the hyperlink provided. Note: it is always best to reference the HTML Specification at either an official W3C or WHATWG resource. (e.g. https://html.spec.whatwg.org/multipage/#toc-semantics )
More info about the history, here:
https://www.cnet.com/culture/growing-pains-afflict-html5-standardization/
The Trailing slash was to promote XML "compatibility" in XHTML, and was typically only considered by the User Agent ONLY if the XHTML Strict Doctype was used. (e.g. Transitional just parsed it as HTML anyway)
The syntax is still widely used incorrectly (e.g. WordPress is allegedly the most popular content management system in use on the web in 2023. View the source of most any WP site, and you'll see it uses incorrect syntax in the HTML. however, it's worth noting that the code-formatting app, Prettier is at least partly to blame)