fix(learn): preserve whitespace in the tool panel (#39973)

This commit is contained in:
Oliver Eyton-Williams
2020-10-14 18:10:15 +02:00
committed by GitHub
parent 3106fe804f
commit a71150074d
5 changed files with 8 additions and 4 deletions

View File

@ -5,6 +5,10 @@
margin: 15px 0; margin: 15px 0;
} }
.challenge-test-suite code {
white-space: pre-wrap;
}
.test-result { .test-result {
display: flex; display: flex;
width: 100%; width: 100%;

View File

@ -28,7 +28,7 @@ if (condition1) {
## Instructions ## Instructions
<section id='instructions'> <section id='instructions'>
Write chained <code>if</code>/<code>else if</code> statements to fulfill the following conditions: Write chained <code>if</code>/<code>else if</code> statements to fulfill the following conditions:
<code>num &lt; 5</code> - return "Tiny"<br><code>num &lt; 10</code> - return "Small"<br><code>num &lt; 15</code> - return "Medium"<br><code>num &lt; 20</code> - return "Large"<br><code>num >= 20</code> - return "Huge" <code>num &lt; 5</code> - return "Tiny"<br><code>num &lt; 10</code> - return "Small"<br><code>num &lt; 15</code> - return "Medium"<br><code>num &lt; 20</code> - return "Large"<br><code>num >= 20</code> - return "Huge"
</section> </section>
## Tests ## Tests

View File

@ -30,7 +30,7 @@ tests:
testString: assert(!code.match(/\.?[\s\S]*?replace/g)); testString: assert(!code.match(/\.?[\s\S]*?replace/g));
- text: <code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>. - text: <code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.
testString: assert(urlSlug("Winter Is Coming") === "winter-is-coming"); testString: assert(urlSlug("Winter Is Coming") === "winter-is-coming");
- text: <code>urlSlug(" Winter Is &nbsp;Coming")</code> should return <code>"winter-is-coming"</code>. - text: <code>urlSlug(" Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.
testString: assert(urlSlug(" Winter Is Coming") === "winter-is-coming"); testString: assert(urlSlug(" Winter Is Coming") === "winter-is-coming");
- text: <code>urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone")</code> should return <code>"a-mind-needs-books-like-a-sword-needs-a-whetstone"</code>. - text: <code>urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone")</code> should return <code>"a-mind-needs-books-like-a-sword-needs-a-whetstone"</code>.
testString: assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone"); testString: assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone");

View File

@ -38,7 +38,7 @@ tests:
testString: assert(typeof combinations === 'function'); testString: assert(typeof combinations === 'function');
- text: <code>combinations(3, 5)</code> should return <code>[[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]</code>. - text: <code>combinations(3, 5)</code> should return <code>[[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]</code>.
testString: assert.deepEqual(combinations(testInput1[0], testInput1[1]), testOutput1); testString: assert.deepEqual(combinations(testInput1[0], testInput1[1]), testOutput1);
- text: <code>combinations(4, 6)</code> should return <code>[[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]]</code> - text: <code>combinations(4, 6)</code> should return <code>[[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]]</code>
testString: assert.deepEqual(combinations(testInput2[0], testInput2[1]), testOutput2); testString: assert.deepEqual(combinations(testInput2[0], testInput2[1]), testOutput2);
``` ```

View File

@ -36,7 +36,7 @@ tests:
testString: assert.deepEqual(arrToObj(...testCases[3]), res[3]); testString: assert.deepEqual(arrToObj(...testCases[3]), res[3]);
- text: '<code>arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4])</code> should return <code>{ "a": 1, "b": 2, "c": 3 , "d": 4, "e": undefined }</code>' - text: '<code>arrToObj(["a", "b", "c", "d", "e"], [1, 2, 3, 4])</code> should return <code>{ "a": 1, "b": 2, "c": 3 , "d": 4, "e": undefined }</code>'
testString: assert.deepEqual(arrToObj(...testCases[4]), res[4]); testString: assert.deepEqual(arrToObj(...testCases[4]), res[4]);
- text: '<code>arrToObj(["a", "b", "c"], [1, 2, 3, 4, 5])</code> should return <code>{ "a": 1, "b": 2, "c": 3 }</code>' - text: '<code>arrToObj(["a", "b", "c"], [1, 2, 3, 4, 5])</code> should return <code>{ "a": 1, "b": 2, "c": 3 }</code>'
testString: assert.deepEqual(arrToObj(...testCases[5]), res[5]); testString: assert.deepEqual(arrToObj(...testCases[5]), res[5]);
``` ```