diff --git a/documentation/docs/07-misc/07-v5-migration-guide.md b/documentation/docs/07-misc/07-v5-migration-guide.md index 5a80734b7a..cbbb3396c7 100644 --- a/documentation/docs/07-misc/07-v5-migration-guide.md +++ b/documentation/docs/07-misc/07-v5-migration-guide.md @@ -682,6 +682,14 @@ Previously, Svelte employed a very complicated algorithm to determine if whitesp - Whitespace between nodes is collapsed to one whitespace - Whitespace at the start and end of a tag is removed completely + + This new behavior is slightly different from native HTML rendering. For example, `
foo - bar
` will render: + + - `foo - bar` in HTML + - `foo- bar` in Svelte 5 + + You can reintroduce the missing space by including it explicitly: `foo{' '}- bar
` + - Certain exceptions apply such as keeping whitespace inside `pre` tags As before, you can disable whitespace trimming by setting the `preserveWhitespace` option in your compiler settings or on a per-component basis in `