Bug: in curriculum parsing? Success even if tag is not closed with ">"

Example: In Responsive Web Design, Learn HTML Forms, Step 11

The following is accepted as success, but it doesn’t have a closing “>”. Also, it’s missing the entire closing tag .

<form action="https://register-demo.freecodecamp.org"

Similarly, in this step, it accepts an unfinished (self-closing) tag that doesn’t include it’s closing “/>”.

The above link accepts this as success:

<link rel="stylesheet" href="styles.css"

The browser is completing the elements the best it can. You end up with a DOM like this.

<body data-new-gr-c-s-check-loaded="14.1163.0" data-gr-ext-installed="">
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form action="https://register-demo.freecodecamp.org" <="" body=""></form>

So the test finds the element as expected.

The same happens with the style element.

So it isn’t a bug, just HTML and the browser doing magic.

We try to avoid regex tests. If we use regex, the tests must account for all valid variations or risk being too strict. They are also harder to read and maintain.

We have talked about validating HTML as part of the tests, but it isn’t easy to implement and has its drawbacks.