Freecodecamp: Test should ignore whitespace

Created on 23 Aug 2016  路  5Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Override All Other Styles by using Important has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


<style>
  body {
    background-color: black;
    font-family: Monospace ;
    color: green;
  }
  #orange-text {
    color: orange ;
  }
  .pink-text     {
    color: pink !important ;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>

Similar to #8511, test is not whitespace tolerant.

first timers only help wanted

Most helpful comment

@BlauFeuer thanks for the issue. Yes, the test should be able to accommodate for spaces.

This line of code needs to be changed so that the regex is changed so that it allows zero or more spaces between !important and the semicolon.

- /\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important;[^\\.]*\\}/g
+ /\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important\\s*;[^\\.]*\\}/g

All 5 comments

@BlauFeuer thanks for the issue. Yes, the test should be able to accommodate for spaces.

This line of code needs to be changed so that the regex is changed so that it allows zero or more spaces between !important and the semicolon.

- /\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important;[^\\.]*\\}/g
+ /\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important\\s*;[^\\.]*\\}/g

This is my first attempt to request a pull for FreeCodeCamp, however I have previously done this 2 or 3 times since joining GitHUB a few months ago - if I do not qualify as a first-timer because of that experience, it was still good practice. Thanks for taking a look at it.

@BlauFeuer just a heads up, your PR might get blocked because the branch name needs to start with fix/ or feature/

The contributing documentation is here: https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/CONTRIBUTING.md

@dhcodes To address guideline #3: Is there a way to rename a branch via GITHUB? I'm somewhat aware that I don't know what I'm doing; I only successfully got to step #2 of Contributing Guidelines. From there it all looks like jargon. I'm not sure how a "first-timer" could mange to follow all those guidelines.

@BlauFeuer You should be able to rename your current branch using:
git branch -m new_branch
while on the branch you want to rename locally.

Then you can re-push your changes with a git push -u origin fix/branch-name-here --force.

You may need to commit again too between those two steps, though I'm not sure it will be necessary.

As for the guidelines, I think they do a good job of providing a first-timer with a full git experience which can be helpful to someone just getting into contributing.

Was this page helpful?
0 / 5 - 0 ratings