question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RWD Beta: Test that requires DOCTYPE to be on its own line is failing

See original GitHub issue

Affected page

Several. One example is Learn HTML Forms by Building a Registration Form / Step 2

Your code

<!DOCTYPE html><html></html>

Expected behavior

The hint for this step seems to indicate that the user must add the html element below the DOCTYPE (there must be at least one new line separating them).

Hint: “Your html element should be below the DOCTYPE declaration.:”

So the expected behavior would be that the user will not pass this step until they add the html element below the DOCTYPE.

System

  • Device: Desktop
  • OS: Linux/Fedora 34
  • Browser: Firefox
  • Version: [e.g. 22]

Additional context

This is happening for several courses. The regex used for this test is not enforcing the newline between the elements. If this requirement is important enough to be enforced then we should probably come up with one regex that enforces this requirement and use it for all courses.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
ShaunSHamiltoncommented, Jan 4, 2022

Would you agree with me then that instead of testing for DOCTYPE being on a separate line we should be testing that the DOCTYPE is the first element on the page?

Ideally, yes. As I mentioned below, we do have a solution to the comment thing, but it is a work-in-progress.

https://github.com/freeCodeCamp/freeCodeCamp/pull/44625#issuecomment-1003978797

1reaction
ShaunSHamiltoncommented, Jan 4, 2022

As far as the tests go, I suggest we stick with this:

  • If the HTML spec can parse it, it is valid, and should be accepted, unless the instructions specifically say, for example, “add a semi-colon at the end of the value”

So, as I can see in the spec, there is no requirement for the DOCTYPE and the html element to be on separate lines:

Read more comments on GitHub >

github_iconTop Results From Across the Web

step 1 of Rothko Painting - skiping html, head and body tag ...
Responsive Web Design (Beta) - step 1 of Rothko Painting - skiping ... RWD Beta: Test that requires DOCTYPE to be on its...
Read more >
The following sections have been defined but have not been ...
It means that you have defined a section in your master Layout.cshtml, but you have not included anything for that section in your...
Read more >
MySQL 1064 Error: You have an error in your SQL syntax
The 1064 error displays any time you have an issue with your SQL syntax, and is often due to using reserved words, missing...
Read more >
XSL Transformations (XSLT) Version 3.0 - W3C
Abstract. This specification defines the syntax and semantics of XSLT 3.0, a language designed primarily for transforming XML documents into ...
Read more >
Testing Guide - OWASP Foundation
ber of possible ways that an application could fail, and organiza- ... testing techniques, and own the validation of security requirements in this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found