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
@ -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(
|
||||
|
Reference in New Issue
Block a user