Merge branch 'staging' of github.com:FreeCodeCamp/freecodecamp into staging
This commit is contained in:
@ -137,7 +137,9 @@ exports.returnIndividualStory = function(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
story = story.pop();
|
story = story.pop();
|
||||||
var dashedNameFull = story.storyLink.toLowerCase().replace(/\s/g, '-');
|
var dashedNameFull = story.storyLink.toLowerCase()
|
||||||
|
.replace(/\s+/g, ' ')
|
||||||
|
.replace(/\s/g, '-');
|
||||||
if (dashedNameFull !== dashedName) {
|
if (dashedNameFull !== dashedName) {
|
||||||
return res.redirect('../news/' + dashedNameFull);
|
return res.redirect('../news/' + dashedNameFull);
|
||||||
}
|
}
|
||||||
@ -328,9 +330,6 @@ exports.storySubmission = function(req, res, next) {
|
|||||||
return next(new Error('Not authorized'));
|
return next(new Error('Not authorized'));
|
||||||
}
|
}
|
||||||
var storyLink = data.headline
|
var storyLink = data.headline
|
||||||
.replace(/\'/g, '')
|
|
||||||
.replace(/\"/g, '')
|
|
||||||
.replace(/,/g, '')
|
|
||||||
.replace(/\s+/g, ' ')
|
.replace(/\s+/g, ' ')
|
||||||
.replace(/[^a-z0-9\s]/gi, '')
|
.replace(/[^a-z0-9\s]/gi, '')
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
@ -349,10 +349,11 @@
|
|||||||
"name": "Bonfire: Mutations",
|
"name": "Bonfire: Mutations",
|
||||||
"difficulty": "1.12",
|
"difficulty": "1.12",
|
||||||
"description": [
|
"description": [
|
||||||
"Return true if the string in the first element of the array contains the letters of the string in the second element of the array.",
|
"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.",
|
||||||
"For example, ['hello', 'Hello'], should return true because all of the letters in the second string are present in the first, ignoring case.",
|
"For example, ['hello', 'Hello'], should return true because all of the letters in the second string are present in the first, ignoring case.",
|
||||||
"The arguments ['hello', 'hey'] should return false because the string 'hello' does not contain a 'y'.",
|
"The arguments ['hello', 'hey'] should return false because the string 'hello' does not contain a 'y'.",
|
||||||
"Another example, ['Alien', 'line'], should return true because all of the letters in 'line' are present in 'Alien'.",
|
"Another example, ['Alien', 'line'], should return true because all of the letters in 'line' are present in 'Alien'.",
|
||||||
|
"Lastly, ['Mary', 'Aarmy'] should return false because 'Mary' is only 4 letters while 'Aarmy' is 5, so 'Mary' can't possibly contain 'Aarmy'",
|
||||||
"Remember to use <a href='/field-guide/how-do-i-get-help-when-I-get-stuck'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
|
"Remember to use <a href='/field-guide/how-do-i-get-help-when-I-get-stuck'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -367,6 +368,7 @@
|
|||||||
"expect(mutation(['hello', 'Hello'])).to.be.true;",
|
"expect(mutation(['hello', 'Hello'])).to.be.true;",
|
||||||
"expect(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;",
|
"expect(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;",
|
||||||
"expect(mutation(['Mary', 'Army'])).to.be.true;",
|
"expect(mutation(['Mary', 'Army'])).to.be.true;",
|
||||||
|
"expect(mutation(['Mary', 'Aarmy'])).to.be.false;",
|
||||||
"expect(mutation(['Alien', 'line'])).to.be.true;"
|
"expect(mutation(['Alien', 'line'])).to.be.true;"
|
||||||
],
|
],
|
||||||
"MDNlinks": ["Array.sort()"],
|
"MDNlinks": ["Array.sort()"],
|
||||||
|
@ -18,8 +18,8 @@ function storyLinkCleanup(cb) {
|
|||||||
console.log(i++);
|
console.log(i++);
|
||||||
this.pause();
|
this.pause();
|
||||||
story.storyLink = story.storyLink.
|
story.storyLink = story.storyLink.
|
||||||
replace(/[^a-z0-9\s]/gi, '').
|
|
||||||
replace(/\s+/g, ' ').
|
replace(/\s+/g, ' ').
|
||||||
|
replace(/[^a-z0-9\s]/gi, '').
|
||||||
toLowerCase().
|
toLowerCase().
|
||||||
trim();
|
trim();
|
||||||
story.save(function (err) {
|
story.save(function (err) {
|
||||||
|
Reference in New Issue
Block a user