freeCodeCamp / curriculum

The freeCodeCamp curriculum and lesson editor
Creative Commons Attribution Share Alike 4.0 International
81 stars 124 forks source link

Bug in Question : Create a Horizontal Line Using the hr Element |Category : Applied Visual Design #247

Open ghost opened 6 years ago

ghost commented 6 years ago

Describe the bug

There is a small bug on the page https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/create-a-horizontal-line-using-the-hr-element/

It prevents from passing right the exam.

The Error: when it is done correctly, an error shows: “The hr tag should come between the title and the paragraph.”

but the solution is right and should pass.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/create-a-horizontal-line-using-the-hr-element/'
  2. Put '
    tag between and

    ' so it becomes like this -> '


    '

  3. Click on 'Run The Tests'
  4. See error 'The hr tag should come between the title and the paragraph.'

Expected behavior

Pass the Test

Screenshots

43356512-62229872-928f-11e8-8523-ec2e7fc8ffb0

Desktop (please complete the following information):

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Additional context

Investigating the issue, I have found in the following file the test condition:

https://learn.freecodecamp.org/path---responsive-web-design-applied-visual-design-create-a-horizontal-line-using-the-hr-element-77f07da18d78a12ddde9.js

Here is the bug in the RegEx: Line 17 :: testString: "assert(code.match(/<\/h4>\s?<hr(>|\s?\/>)\s*?/gi), 'The hr tag should come between the title and the paragraph.');" So the RegEx will validate the following, which is wrong:

The Solution

File :: https://learn.freecodecamp.org/path---responsive-web-design-applied-visual-design-create-a-horizontal-line-using-the-hr-element-77f07da18d78a12ddde9.js

Line 17 :: testString: “assert(code.match(/<\/h4>\s?<hr(>|\s?\/>)\s*?/gi), ‘The hr tag should come between the title and the paragraph.’);”

The error looks fixed in the following file:

File :: https://github.com/freeCodeCamp/curriculum/blob/dev/challenges/01-responsive-web-design/applied-visual-design.json

Line 560 :: "assert(code.match(/<\/h4>\s?<hr(>|\s?\/>)\s*?

/gi)

But still not fixed on the website page and js file: https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/create-a-horizontal-line-using-the-hr-element/

https://learn.freecodecamp.org/path---responsive-web-design-applied-visual-design-create-a-horizontal-line-using-the-hr-element-77f07da18d78a12ddde9.js

Nirajn2311 commented 6 years ago

The learn website gets its challenges from this repo depending on the version mentioned in the package.json in learn repo. Currently curriculum repo is at v3.1.2 bu the learn repo is using v3.1.1. So the issue will be there until it is updated.

nathanhannig commented 6 years ago

I have created issue in learn repo. Hopefully it gets some attention soon.