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(nuxt): only add/remove trailing slash for http protocols #23296

Merged
merged 349 commits into from Dec 12, 2023

Conversation

manniL
Copy link
Member

@manniL manniL commented Sep 19, 2023

πŸ”— Linked issue

resolves #23295

Related: unjs/ufo#175, unjs/ufo#189

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

While unjs/ufo#189 is still pending, Nuxt can have a solution on it's own to avoid adding/removing slashes from provided URLs unless the http/https protocol is set.
This is important for e.g. mailto:abc@example.com links.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Sep 19, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@manniL manniL changed the title fix(nuxt-link): trailing slash behavior for fragment and protocol fix(link): trailing slash behavior for fragment and protocol Sep 19, 2023
@manniL manniL changed the title fix(link): trailing slash behavior for fragment and protocol fix(nuxt): trailing slash behavior for fragment and protocol Sep 19, 2023
@manniL manniL marked this pull request as draft September 19, 2023 13:11
@manniL manniL marked this pull request as ready for review September 19, 2023 13:33
@danielroe
Copy link
Member

danielroe commented Sep 19, 2023

This looks good to me, but it seems well on the way to being merged in unjs/ufo#175, so we probably can avoid merging here.

@manniL
Copy link
Member Author

manniL commented Sep 20, 2023

@danielroe Do you think that ufo should support exactly this feature set (fragment/protocol handling like implemented) too out of the box? πŸ€”

@manniL
Copy link
Member Author

manniL commented Sep 20, 2023

Will adapt this PR as soon as unjs/ufo#175 lands πŸ‘

@manniL manniL marked this pull request as draft September 20, 2023 13:07
@manniL manniL removed the request for review from lihbr September 20, 2023 13:07
Atinux and others added 19 commits December 11, 2023 23:14
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copy link

nuxt-studio bot commented Dec 11, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview 4dcaa2a

@manniL manniL changed the title fix(nuxt): trailing slash behavior for fragment and protocol fix(nuxt): trailing slash behavior for non-http based protocol Dec 11, 2023
@manniL manniL marked this pull request as ready for review December 11, 2023 22:23
@danielroe danielroe changed the title fix(nuxt): trailing slash behavior for non-http based protocol fix(nuxt): do not add/remove trailing slash for non-http protocols Dec 12, 2023
@danielroe danielroe changed the title fix(nuxt): do not add/remove trailing slash for non-http protocols fix(nuxt): only add/remove trailing slash for http protocols Dec 12, 2023
@danielroe danielroe merged commit 5d0e7e9 into main Dec 12, 2023
38 checks passed
@danielroe danielroe deleted the fix/nuxt-trailing-slash branch December 12, 2023 12:52
@github-actions github-actions bot mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trailing Slash behavior for fragment links or various protocols (e.g. mailto:)