Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly infer <a> tag namespace #14134

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Conversation

dummdidumm
Copy link
Member

<a> tags are valid in both the SVG and HTML namespace. If there's no parent, we therefore have to look downwards to see if it's the parent of a SVG or HTML element.

fixes #7807
fixes #13793

Before submitting the PR, please make sure you do the following

  • 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
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

 `<a>` tags are valid in both the SVG and HTML namespace.  If there's no parent, we therefore have to look downwards to see if it's the parent of a SVG or HTML element.

fixes #7807
fixes #13793
@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-svelte-14134-svelte.vercel.app/

this is an automated message

Copy link

pkg-pr-new bot commented Nov 3, 2024

pnpm add https://pkg.pr.new/svelte@14134

commit: 7e70188

@trueadm
Copy link
Contributor

trueadm commented Nov 3, 2024

Whilst this is better, it still doesn't feel perfect. Ultimately, I think we need to determine this somehow at runtime but let's get this improvement in first.

@dummdidumm dummdidumm merged commit 551284c into main Nov 3, 2024
11 checks passed
@dummdidumm dummdidumm deleted the a-tag-namespace-fix branch November 3, 2024 14:04
@github-actions github-actions bot mentioned this pull request Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants