svelte
svelte copied to clipboard
fix: allow attributes on the title element
The spec states the title element supports global attributes. https://html.spec.whatwg.org/#the-title-element
Reverts the title attribute validation introduced in #1721.
Fixes #5198.
Before submitting the PR, please make sure you do the following
- [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [x] Prefix your PR title with
feat:,fix:,chore:, ordocs:. - [x] This message body should clearly illustrate what problems it solves.
- [x] Ideally, include a test that fails without this PR but passes with it.
- [x] If this PR changes code within
packages/svelte/src, add a changeset (npx changeset).
Tests and linting
The test plan is to re-use packages/svelte/tests/validator/samples/title-no-attributes. By removing errors.json, we test that svelte compiles the title element with attributes.
- [x] Run the tests with
pnpm testand lint the project withpnpm lint
The tests pass, but pnpm lint failed with:
> [email protected] lint /opt/p/svelte
> eslint && prettier --check .
Oops! Something went wrong! :(
ESLint: 9.9.1
Error: Cannot find module '/opt/p/svelte/node_modules/.pnpm/[email protected]_svelte@packages+svelte/node_modules/svelte/compiler/index.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1441:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1430:15)