Skip to content

Commit 5d1fbec

Browse files
committed
Add docs for foreign
1 parent e13c0f7 commit 5d1fbec

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

site/content/docs/02-template-syntax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ The `<svelte:options>` element provides a place to specify per-component compile
15321532
* `immutable={false}` — the default. Svelte will be more conservative about whether or not mutable objects have changed
15331533
* `accessors={true}` — adds getters and setters for the component's props
15341534
* `accessors={false}` — the default
1535-
* `namespace="..."` — the namespace where this component will be used, most commonly "svg"
1535+
* `namespace="..."` — the namespace where this component will be used, most commonly "svg". (Use the "foreign" namespace to opt out of case insensitive attribute names and html specific warnings)
15361536
* `tag="..."` — the name to use when compiling this component as a custom element
15371537

15381538
```sv

site/content/docs/04-compile-time.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The following options can be passed to the compiler. None are required:
8080
| `outputFilename` | `null` | A `string` used for your JavaScript sourcemap.
8181
| `cssOutputFilename` | `null` | A `string` used for your CSS sourcemap.
8282
| `sveltePath` | `"svelte"` | The location of the `svelte` package. Any imports from `svelte` or `svelte/[module]` will be modified accordingly.
83-
83+
| `namespace` | `null` | The namespace of the element if not `html` (eg `mathml`, `svg`, `foreign`).
8484

8585
---
8686

src/compiler/utils/namespaces.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// the foreign namespace covers all DOM implementations that aren't html5. It opts out of html5 specific a11y checks
2+
// and case insensitive attribute names
13
export const foreign = 'https://svelte.dev/docs#svelte_options';
24
export const html = 'http://www.w3.org/1999/xhtml';
35
export const mathml = 'http://www.w3.org/1998/Math/MathML';

0 commit comments

Comments
 (0)