fix(learn): address escaped backticks (#40717)
* fix(learn): address escaped backticks Addresses the instances of escaped backticks - where a backtick is preceded by a backslash. In most cases, this was left over from the old parser. In some cases, a backtick was intended to be wrapped in code tags and has been adjusted accordingly. This issue came to light due to a bug in the translation flow on Crowdin. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> * fix: EVEN MORE :( :( :( Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> * fix: backslash nightmares Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> * fix: When you wish upon a ******* Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> * fix(curriculum): md error introduced by formatter * fix(curriculum): remove extra `s * fix: restore quote symbol Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> * fix: Typo Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: apply review changes Applying review feedback from call with @RandellDawson. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> * fix: markdown does weird stuff sometimes Can't stick backticks together - use code. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f61f1dc55d
commit
8d8d25e9f2
@@ -7,7 +7,7 @@ dashedName: part-26
|
||||
|
||||
# --description--
|
||||
|
||||
Add double quote marks around the word "Store" in the line "You see a sign that says Store." Before each quotation mark add a `\` to signal that the following quote is not the end of the string, but should instead appear inside the string. This is called escaping.
|
||||
Add double quote marks around the word "Store" in the line "You see a sign that says Store." Before each quotation mark add a <code>\\</code> to signal that the following quote is not the end of the string, but should instead appear inside the string. This is called escaping.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
@@ -30,7 +30,7 @@ You will need to use escape sequences to insert special characters correctly. Yo
|
||||
|
||||
Here is the text with the escape sequences written out.
|
||||
|
||||
"FirstLine```newline``tab``backslash```SecondLine`newline`ThirdLine"
|
||||
"FirstLine<code>newline</code><code>tab</code><code>backslash</code>SecondLine`newline`ThirdLine"
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -60,7 +60,7 @@ assert(/FirstLine\n/.test(myStr));
|
||||
assert(/\n\t/.test(myStr));
|
||||
```
|
||||
|
||||
`SecondLine` should be preceded by the backslash character `\`
|
||||
`SecondLine` should be preceded by the backslash character <code>\\</code>
|
||||
|
||||
```js
|
||||
assert(/\\SecondLine/.test(myStr));
|
||||
|
@@ -11,7 +11,7 @@ dashedName: escaping-literal-quotes-in-strings
|
||||
|
||||
When you are defining a string you must start and end with a single or double quote. What happens when you need a literal quote: `"` or `'` inside of your string?
|
||||
|
||||
In JavaScript, you can <dfn>escape</dfn> a quote from considering it as an end of string quote by placing a <dfn>backslash</dfn> (`\`) in front of the quote.
|
||||
In JavaScript, you can <dfn>escape</dfn> a quote from considering it as an end of string quote by placing a <dfn>backslash</dfn> (<code>\\</code>) in front of the quote.
|
||||
|
||||
`var sampleStr = "Alan said, \"Peter is learning JavaScript\".";`
|
||||
|
||||
|
@@ -29,8 +29,9 @@ goodStr = 'Jake asks Finn, "Hey, let\'s go on an adventure?"';
|
||||
badStr = 'Finn responds, "Let's go!"'; // Throws an error
|
||||
```
|
||||
|
||||
In the <dfn>goodStr</dfn> above, you can use both quotes safely by using the backslash `\` as an escape character. **Note**
|
||||
The backslash `\` should not be confused with the forward slash `/`. They do not do the same thing.
|
||||
In the <dfn>goodStr</dfn> above, you can use both quotes safely by using the backslash <code>\\</code> as an escape character.
|
||||
|
||||
**Note:** The backslash <code>\\</code> should not be confused with the forward slash `/`. They do not do the same thing.
|
||||
|
||||
# --instructions--
|
||||
|
||||
@@ -40,7 +41,7 @@ Right now, the `<a>` tag in the string uses double quotes everywhere. You will n
|
||||
|
||||
# --hints--
|
||||
|
||||
You should remove all the `backslashes` (`\`).
|
||||
You should remove all the `backslashes` (<code>\\</code>).
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
@@ -22,7 +22,7 @@ const quoteInString = "Groucho Marx once said 'Quote me as saying I was mis-quot
|
||||
const uhOhGroucho = 'I've had a perfectly wonderful evening, but this wasn't it.';
|
||||
```
|
||||
|
||||
Of course, it is okay to use only one style of quotes. You can escape the quotes inside the string by using the backslash (`\`) escape character:
|
||||
Of course, it is okay to use only one style of quotes. You can escape the quotes inside the string by using the backslash (<code>\\</code>) escape character:
|
||||
|
||||
```js
|
||||
// Correct use of same quotes:
|
||||
|
@@ -28,8 +28,7 @@ matStr.match(bgRegex); // Returns null
|
||||
|
||||
Match all the letters in the string `quoteSample`.
|
||||
|
||||
**Note**
|
||||
Be sure to match both upper- and lowercase **letters**.\*\*\*\*
|
||||
**Note**: Be sure to match both uppercase and lowercase letters.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
@@ -12,7 +12,7 @@ Some patterns you search for will occur multiple times in a string. It is wastef
|
||||
|
||||
You can search for repeat substrings using <dfn>capture groups</dfn>. Parentheses, `(` and `)`, are used to find repeat substrings. You put the regex of the pattern that will repeat in between the parentheses.
|
||||
|
||||
To specify where that repeat string will appear, you use a backslash (`\`) and then a number. This number starts at 1 and increases with each additional capture group you use. An example would be `\1` to match the first group.
|
||||
To specify where that repeat string will appear, you use a backslash (<code>\\</code>) and then a number. This number starts at 1 and increases with each additional capture group you use. An example would be `\1` to match the first group.
|
||||
|
||||
The example below matches any word that occurs twice separated by a space:
|
||||
|
||||
|
Reference in New Issue
Block a user