-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #828 from preactjs/htm-comments
- Loading branch information
Showing
5 changed files
with
169 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'wmr': patch | ||
--- | ||
|
||
Fix missing props when there were comments between attributes in 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
19 changes: 19 additions & 0 deletions
19
packages/wmr/test/fixtures/transformations/jsx-comment.expected.js
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,19 @@ | ||
import { html as $$html } from '/@npm/htm/preact'; | ||
// prettier-ignore | ||
export const a = $$html`<div | ||
id="foo" | ||
disabled | ||
/>` | ||
|
||
// prettier-ignore | ||
export const b = $$html`<div | ||
id="foo" | ||
/>` | ||
|
||
const Foo = () => null; | ||
// prettier-ignore | ||
export const c = $$html`<div | ||
id="foo" | ||
> | ||
<${Foo} foo=${2} /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// prettier-ignore | ||
export const a = <div | ||
// comment 1 | ||
id="foo" | ||
// comment 2 | ||
disabled | ||
// comment 3 | ||
/> | ||
|
||
// prettier-ignore | ||
export const b = <div | ||
// comment 1 | ||
// comment 2 | ||
id="foo" | ||
// comment 3 | ||
// comment 3 | ||
/> | ||
|
||
const Foo = () => null; | ||
// prettier-ignore | ||
export const c = <div | ||
/* a */ | ||
id="foo" | ||
/* b */ | ||
/* c */ | ||
> | ||
<Foo /*asd*/ foo={2} /*asd*//> | ||
</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