Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix svelte2tsx parentheses overwrite issues (#302)
* fix parentheses overwrite for await block * fix class directive parentheses overwrite
- Loading branch information
1 parent
bfb4133
commit 17bfd6e
Showing
7 changed files
with
36 additions
and
9 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
9 changes: 9 additions & 0 deletions
9
packages/svelte2tsx/test/htmlx2jsx/samples/await-block-parentheses/expected.jsx
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,9 @@ | ||
<>{() => {let _$$p = (somePromise); _$$p.then((value) => {<> | ||
<h1>Promise Resolved</h1> | ||
</>})}} | ||
|
||
{() => {let _$$p = (somePromise); <> | ||
<h1>Loading...</h1> | ||
</>; _$$p.then(() => {<> | ||
<h1>Promise Resolved</h1> | ||
</>})}}</> |
9 changes: 9 additions & 0 deletions
9
packages/svelte2tsx/test/htmlx2jsx/samples/await-block-parentheses/input.svelte
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,9 @@ | ||
{#await (somePromise) then value} | ||
<h1>Promise Resolved</h1> | ||
{/await} | ||
|
||
{#await (somePromise)} | ||
<h1>Loading...</h1> | ||
{:then} | ||
<h1>Promise Resolved</h1> | ||
{/await} |
1 change: 1 addition & 0 deletions
1
packages/svelte2tsx/test/htmlx2jsx/samples/class-parentheses/expected.jsx
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 @@ | ||
<><h1 {...__sveltets_ensureType(Boolean, !!("test"=="test"))}>Hello</h1></> |
1 change: 1 addition & 0 deletions
1
packages/svelte2tsx/test/htmlx2jsx/samples/class-parentheses/input.svelte
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 @@ | ||
<h1 class:active={("test"=="test")}>Hello</h1> |
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 +1,2 @@ | ||
<><h1 {...__sveltets_ensureType(Boolean, !!("test"=="test"))}>Hello</h1></> | ||
<><h1 {...__sveltets_ensureType(Boolean, !!("test"=="test"))}>Hello</h1> | ||
<h1 {...__sveltets_ensureType(Boolean, !!("test"=="test"))}>Hello</h1></> |
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 +1,2 @@ | ||
<h1 class:active={"test"=="test"}>Hello</h1> | ||
<h1 class:active={"test"=="test"}>Hello</h1> | ||
<h1 class:active="{"test"=="test"}">Hello</h1> |