diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 3d396f2f24..ae07c90993 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -111,6 +111,27 @@ Text can also contain JavaScript expressions: ``` +### Comments + +--- + +You can use HTML comments inside components. + +```html +<!-- this is a comment! --> +<h1>Hello world</h1> +``` + +--- + +Comments beginning with `svelte-ignore` disable warnings for the next block of markup. Usually these are accessibility warnings; make sure that you're disabling them for a good reason. + +```html +<!-- svelte-ignore a11y-autofocus --> +<input bind:value={name} autofocus> +``` + + ### {#if ...} ```sv