Skip to content

Commit

Permalink
feat: support <svelte:html> (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Nov 20, 2024
1 parent 078f9a0 commit cd1758b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/language-server/src/plugins/html/dataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ const svelteTags: ITagData[] = [
}
]
},
{
name: 'svelte:html',
description:
'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.',
attributes: []
},
{
name: 'svelte:document',
description:
Expand Down
2 changes: 2 additions & 0 deletions packages/svelte2tsx/src/htmlxtojsx_v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export function convertHtmlxToJsx(
case 'Title':
case 'Document':
case 'Body':
case 'SvelteHTML':
case 'SvelteBoundary':
case 'Slot':
case 'SlotTemplate':
Expand Down Expand Up @@ -239,6 +240,7 @@ export function convertHtmlxToJsx(
case 'Head':
case 'Title':
case 'Body':
case 'SvelteHTML':
case 'SvelteBoundary':
case 'Document':
case 'Slot':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ svelteHTML.createElement("svelte:html", { "lang":`de`,}); }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svelte:html lang="de"></svelte:html>

0 comments on commit cd1758b

Please sign in to comment.