diff --git a/.changeset/twelve-mayflies-decide.md b/.changeset/twelve-mayflies-decide.md
new file mode 100644
index 0000000000..01d72c46bd
--- /dev/null
+++ b/.changeset/twelve-mayflies-decide.md
@@ -0,0 +1,5 @@
+---
+'svelte': patch
+---
+
+fix: strip BOM character from input
diff --git a/documentation/docs/01-introduction/01-overview.md b/documentation/docs/01-introduction/01-overview.md
index a0901b9518..b1218232db 100644
--- a/documentation/docs/01-introduction/01-overview.md
+++ b/documentation/docs/01-introduction/01-overview.md
@@ -25,6 +25,6 @@ Svelte is a web UI framework that uses a compiler to turn declarative component
...into tightly optimized JavaScript that updates the document when state like count changes. Because the compiler can 'see' where count is referenced, the generated code is highly efficient, and because we're hijacking syntax like `$state(...)` and `=` instead of using cumbersome APIs, you can write less code.
-Besides being fun to work with, Svelte offers a lot of features built-in, such as animations and transitions. Once you've written your first components you can reach for our batteries included metaframework [SvelteKit](/docs/kit) which provides you with an opinionated router, data loading and more.
+Besides being fun to work with, Svelte offers a lot of features built-in, such as animations and transitions. Once you've written your first components you can reach for our batteries included metaframework [SvelteKit](../kit) which provides you with an opinionated router, data loading and more.
If you're new to Svelte, visit the [interactive tutorial](/tutorial) before consulting this documentation. You can try Svelte online using the [REPL](/repl). Alternatively, if you'd like a more fully-featured environment, you can try Svelte on [StackBlitz](https://sveltekit.new).
diff --git a/documentation/docs/01-introduction/03-reactivity-fundamentals.md b/documentation/docs/01-introduction/03-reactivity-fundamentals.md
index e2f2f4309c..fd884d22dc 100644
--- a/documentation/docs/01-introduction/03-reactivity-fundamentals.md
+++ b/documentation/docs/01-introduction/03-reactivity-fundamentals.md
@@ -10,7 +10,7 @@ Svelte 5 uses _runes_, a powerful set of primitives for controlling reactivity i
Runes are function-like symbols that provide instructions to the Svelte compiler. You don't need to import them from anywhere — when you use Svelte, they're part of the language.
-The following sections introduce the most important runes for declare state, derived state and side effects at a high level. For more details refer to the later sections on [state](/docs/svelte/runes/state) and [side effects](/docs/svelte/runes/side-effects).
+The following sections introduce the most important runes for declare state, derived state and side effects at a high level. For more details refer to the later sections on [state](state) and [side effects](side-effects).
## `$state`
diff --git a/documentation/docs/02-template-syntax/01-component-fundamentals.md b/documentation/docs/02-template-syntax/01-component-fundamentals.md
index fc81bb24bd..c3042be7d7 100644
--- a/documentation/docs/02-template-syntax/01-component-fundamentals.md
+++ b/documentation/docs/02-template-syntax/01-component-fundamentals.md
@@ -112,7 +112,7 @@ If you export a `const`, `class` or `function`, it is readonly from outside the
```
-Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](/docs/component-directives#bind-this).
+Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](bindings#bind:this).
### Reactive variables
diff --git a/documentation/docs/02-template-syntax/06-transitions-and-animations.md b/documentation/docs/02-template-syntax/06-transitions-and-animations.md
index 753c07e86a..a82e40928c 100644
--- a/documentation/docs/02-template-syntax/06-transitions-and-animations.md
+++ b/documentation/docs/02-template-syntax/06-transitions-and-animations.md
@@ -79,7 +79,7 @@ Transitions are local by default. Local transitions only play when the block the
{/if}
```
-> By default intro transitions will not play on first render. You can modify this behaviour by setting `intro: true` when you [create a component](/docs/runtime/imperative-component-api) and marking the transition as `global`.
+> By default intro transitions will not play on first render. You can modify this behaviour by setting `intro: true` when you [create a component](imperative-component-api) and marking the transition as `global`.
## Transition parameters
@@ -312,7 +312,7 @@ DOMRect {
An animation is triggered when the contents of a [keyed each block](control-flow#each) are re-ordered. Animations do not run when an element is added or removed, only when the index of an existing data item within the each block changes. Animate directives must be on an element that is an _immediate_ child of a keyed each block.
-Animations can be used with Svelte's [built-in animation functions](/docs/svelte/reference/svelte-animate) or [custom animation functions](#custom-animation-functions).
+Animations can be used with Svelte's [built-in animation functions](svelte-animate) or [custom animation functions](#custom-animation-functions).
```svelte
diff --git a/documentation/docs/02-template-syntax/09-special-elements.md b/documentation/docs/02-template-syntax/09-special-elements.md
index 86fad4fa18..2b41d55fe4 100644
--- a/documentation/docs/02-template-syntax/09-special-elements.md
+++ b/documentation/docs/02-template-syntax/09-special-elements.md
@@ -122,7 +122,7 @@ All except `scrollX` and `scrollY` are readonly.
```
-Similarly to ``, this element allows you to add listeners to events on `document`, such as `visibilitychange`, which don't fire on `window`. It also lets you use [actions](/docs/element-directives#use-action) on `document`.
+Similarly to ``, this element allows you to add listeners to events on `document`, such as `visibilitychange`, which don't fire on `window`. It also lets you use [actions](actions) on `document`.
As with ``, this element may only appear the top level of your component and must never be inside a block or element.
@@ -145,7 +145,7 @@ All are readonly.
```
-Similarly to ``, this element allows you to add listeners to events on `document.body`, such as `mouseenter` and `mouseleave`, which don't fire on `window`. It also lets you use [actions](/docs/element-directives#use-action) on the `` element.
+Similarly to ``, this element allows you to add listeners to events on `document.body`, such as `mouseenter` and `mouseleave`, which don't fire on `window`. It also lets you use [actions](actions) on the `` element.
As with `` and ``, this element may only appear the top level of your component and must never be inside a block or element.
@@ -176,14 +176,14 @@ As with ``, `` and ``, this element
```
-The `` element provides a place to specify per-component compiler options, which are detailed in the [compiler section](/docs/svelte-compiler#compile). The possible options are:
+The `` element provides a place to specify per-component compiler options, which are detailed in the [compiler section](svelte-compiler#compile). The possible options are:
- `immutable={true}` — you never use mutable data, so the compiler can do simple referential equality checks to determine if values have changed
- `immutable={false}` — the default. Svelte will be more conservative about whether or not mutable objects have changed
- `accessors={true}` — adds getters and setters for the component's props
- `accessors={false}` — the default
- `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
-- `customElement={...}` — the [options](/docs/custom-elements-api#component-options) to use when compiling this component as a custom element. If a string is passed, it is used as the `tag` option
+- `customElement={...}` — the [options](custom-elements#component-options) to use when compiling this component as a custom element. If a string is passed, it is used as the `tag` option
```svelte
diff --git a/documentation/docs/02-template-syntax/10-data-fetching.md b/documentation/docs/02-template-syntax/10-data-fetching.md
index 4116772f7b..ba424e1721 100644
--- a/documentation/docs/02-template-syntax/10-data-fetching.md
+++ b/documentation/docs/02-template-syntax/10-data-fetching.md
@@ -82,4 +82,4 @@ Similarly, if you only want to show the error state, you can omit the `then` blo
## SvelteKit loaders
-Fetching inside your components is great for simple use cases, but it's prone to data loading waterfalls and makes code harder to work with because of the promise handling. SvelteKit solves this problem by providing a opinionated data loading story that is coupled to its router. Learn more about it [in the docs](/docs/kit).
+Fetching inside your components is great for simple use cases, but it's prone to data loading waterfalls and makes code harder to work with because of the promise handling. SvelteKit solves this problem by providing a opinionated data loading story that is coupled to its router. Learn more about it [in the docs](../kit).
diff --git a/documentation/docs/03-runes/02-side-effects.md b/documentation/docs/03-runes/02-side-effects.md
index 4cef5228ca..3d425f8ee3 100644
--- a/documentation/docs/03-runes/02-side-effects.md
+++ b/documentation/docs/03-runes/02-side-effects.md
@@ -94,7 +94,7 @@ $effect(() => {
});
```
-An effect only reruns when the object it reads changes, not when a property inside it changes. (If you want to observe changes _inside_ an object at dev time, you can use [`$inspect`](/docs/svelte/misc/debugging#$inspect).)
+An effect only reruns when the object it reads changes, not when a property inside it changes. (If you want to observe changes _inside_ an object at dev time, you can use [`$inspect`](debugging#$inspect).)
```svelte