Skip to content

Generated HTML markup for Option Groups is invalid #740

@SteveTheTechie

Description

@SteveTheTechie

Reference https://validator.w3.org/#validate_by_input

The following models the way that anchor tags are used in the generated markup for option groups. However, this markup is flagged as invalid HTML by the HTML validator. (I suspected it would be.)

<!DOCTYPE HTML SYSTEM>
<html>
<head>
<title>tester</title>
</head>
<body>
<ul>
<a href="https://www.google.com/">test</a>
<li>test2</li>
</ul>
</body>
</html>

If the anchor can somehow be wrapped in a <li>, it is then valid... e.g. the following validates fine:

<!DOCTYPE HTML SYSTEM>
<html>
<head>
<title>tester</title>
</head>
<body>
<ul>
<li><a href="https://www.google.com/">test</a></li>
<li>test2</li>
</ul>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions