Skip to content

Commit 58f514f

Browse files
committed
docs: add known limitation for comments #21
1 parent c976cab commit 58f514f

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ interface CreateConfigOptions {
145145
}
146146
```
147147

148+
## Limitations
149+
150+
### Comments in script blocks
151+
152+
Single line comments in Svelte script blocks are not supported.
153+
154+
Use multi-line comments instead.
155+
156+
```diff
157+
- let toggled; // comment
158+
+ let toggled; /** comment */
159+
```
160+
148161
## Prior art
149162

150163
This project is inspired by [MDsveX](https://github.com/pngwn/mdsvex).

test/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,32 @@ Second script block:
6969
```svelte
7070
<script>
7171
import Button from "my-svelte-component";
72+
73+
74+
let toggled; /** comment */
7275
</script>
7376
7477
<Button
78+
bind:toggled
7579
attribute="value"
7680
on:click={() => {
7781
console.log("hello world");
7882
}}
79-
>Print 'hello world'</Button>
83+
>Print 'hello world'</Button
84+
>
85+
86+
{toggled}
87+
88+
```
89+
90+
```svelte no-eval
91+
<script>
92+
import { onMount } from "svelte";
93+
94+
onMount(() => {
95+
document.title = 'title';
96+
});
97+
</script>
8098
8199
```
82100

test/src/Button.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
<button type="button" on:click><slot /></button>
1+
<script>
2+
export let toggled = false;
3+
</script>
4+
5+
<button type="button" on:click on:click={() => (toggled = !toggled)}><slot /></button>

0 commit comments

Comments
 (0)