Whitespaces after a tag name break tests

So, currently looking through Responsive Web Design <h2> tutorial.

I used to carry tags’ closing brakets to the next line within <body> to prevent unwanted space between elements, like this:

<h1>Hello World</h1
><h2>CatPhotoApp</h2>

The last test fails in this case (“Your h1 element should be before your h2 element.”); actually, if there is any spacing between a tag name and its closing bracket (so the 2nd test can be false-failed too), while the standard says it’s OK (§13.1.2.1.5, §13.1.2.2.4).

I’m not sure if this https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/headline-with-the-h2-element.md (2 links max for new users) file directly configures the challenge, but the patterns in the asserts apparently doesn’t allow the aforementioned whitespaces. Seeing how they’re case-insensitive and space-indulgent with tags’ inner text, they should be standard-friendly as well.

I assume this style of tests isn’t unique to this particular challenge. I see some DOM checks in the asserts; maybe they should be used more widely.

P. S. Great thanks for saving post drafts! Chrome’s main process making a suicidal dive into the page file happens to be quite annoying.

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.