Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #7264
- Loading branch information
Showing
22 changed files
with
313 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export const whitespace = /[ \t\r\n]/; | ||
export const start_whitespace = /^[ \t\r\n]*/; | ||
export const end_whitespace = /[ \t\r\n]*$/; | ||
export const start_newline = /^\r?\n/; | ||
|
||
export const dimensions = /^(?:offset|client)(?:Width|Height)$/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[main.svelte] | ||
trim_trailing_whitespace = unset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[main.svelte] | ||
trim_trailing_whitespace = unset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export default { | ||
test({ assert, target }) { | ||
// Test for <textarea> tag | ||
const elementTextarea = target.querySelector('#textarea'); | ||
// Test for <textarea> tag in non <textarea> tag | ||
const elementDivWithTextarea = target.querySelector('#div-with-textarea'); | ||
// Test for <textarea> tag with leading newline | ||
const elementTextareaWithLeadingNewline = target.querySelector('#textarea-with-leading-newline'); | ||
const elementTextareaWithoutLeadingNewline = target.querySelector('#textarea-without-leading-newline'); | ||
const elementTextareaWithMultipleLeadingNewline = target.querySelector('#textarea-with-multiple-leading-newlines'); | ||
const elementDivWithTextareaWithMultipleLeadingNewline = target.querySelector('#div-with-textarea-with-multiple-leading-newlines'); | ||
|
||
assert.equal( | ||
elementTextarea.value, | ||
` A | ||
B | ||
` | ||
); | ||
assert.equal( | ||
elementDivWithTextarea.children[0].value, | ||
` A | ||
B | ||
` | ||
); | ||
assert.equal(elementTextareaWithLeadingNewline.children[0].value, 'leading newline'); | ||
assert.equal(elementTextareaWithLeadingNewline.children[1].value, ' leading newline and spaces'); | ||
assert.equal(elementTextareaWithLeadingNewline.children[2].value, '\nleading newlines'); | ||
assert.equal(elementTextareaWithoutLeadingNewline.children[0].value, 'without spaces'); | ||
assert.equal(elementTextareaWithoutLeadingNewline.children[1].value, ' with spaces '); | ||
assert.equal(elementTextareaWithoutLeadingNewline.children[2].value, ' \nnewline after leading space'); | ||
assert.equal(elementTextareaWithMultipleLeadingNewline.value, '\n\nmultiple leading newlines'); | ||
assert.equal(elementDivWithTextareaWithMultipleLeadingNewline.children[0].value, '\n\nmultiple leading newlines'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<textarea id="textarea"> | ||
A | ||
B | ||
</textarea> | ||
|
||
<div id="div-with-textarea"> | ||
<textarea> | ||
A | ||
B | ||
</textarea> | ||
</div> | ||
|
||
<div id="textarea-with-leading-newline"> | ||
<textarea> | ||
leading newline</textarea> | ||
<textarea> | ||
leading newline and spaces</textarea> | ||
<textarea> | ||
|
||
leading newlines</textarea> | ||
</div> | ||
|
||
<div id="textarea-without-leading-newline"> | ||
<textarea>without spaces</textarea> | ||
<textarea> with spaces </textarea> | ||
<textarea> | ||
newline after leading space</textarea> | ||
</div> | ||
|
||
<textarea id="textarea-with-multiple-leading-newlines"> | ||
|
||
|
||
multiple leading newlines</textarea> | ||
|
||
<div id="div-with-textarea-with-multiple-leading-newlines"> | ||
<textarea> | ||
|
||
|
||
multiple leading newlines</textarea> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[{main.svelte,_expected.html}] | ||
trim_trailing_whitespace = unset |
Oops, something went wrong.