Skip to content

Commit cd1758b

Browse files
authored
feat: support <svelte:html> (#2599)
1 parent 078f9a0 commit cd1758b

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

packages/language-server/src/plugins/html/dataProvider.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ const svelteTags: ITagData[] = [
200200
}
201201
]
202202
},
203+
{
204+
name: 'svelte:html',
205+
description:
206+
'This element allows you to add properties and listeners to events on `document.documentElement`. This is useful for attributes such as `lang` which influence how the browser interprets the content.',
207+
attributes: []
208+
},
203209
{
204210
name: 'svelte:document',
205211
description:

packages/svelte2tsx/src/htmlxtojsx_v2/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export function convertHtmlxToJsx(
135135
case 'Title':
136136
case 'Document':
137137
case 'Body':
138+
case 'SvelteHTML':
138139
case 'SvelteBoundary':
139140
case 'Slot':
140141
case 'SlotTemplate':
@@ -239,6 +240,7 @@ export function convertHtmlxToJsx(
239240
case 'Head':
240241
case 'Title':
241242
case 'Body':
243+
case 'SvelteHTML':
242244
case 'SvelteBoundary':
243245
case 'Document':
244246
case 'Slot':
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ svelteHTML.createElement("svelte:html", { "lang":`de`,}); }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svelte:html lang="de"></svelte:html>

0 commit comments

Comments
 (0)