From 8170d4f455a0ce036ef0ce633d90b4548285da20 Mon Sep 17 00:00:00 2001 From: Richard Harris <richard.a.harris@gmail.com> Date: Sun, 4 Aug 2019 12:16:06 -0400 Subject: [PATCH] add docs --- site/content/docs/02-template-syntax.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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