- Notifications
You must be signed in to change notification settings - Fork29.5k
Open
Description
Link to the code that reproduces this issue
https://github.com/rottabonus/next-text-fragment-repro/tree/main
To Reproduce
- Prerequisites: docker
- Clone the repo
- Build images and start docker-compose stack with
docker compose up
- Check the application urls
http://localhost:3000/#:~:text=flaskhttp://localhost:3001/#:~:text=nexthttp://localhost:3002/#:~:text=astro
Notice that the text-fragment is stripped on the nextjs-application
Current vs. Expected behavior
The text fragment feature is not a standard, but maybe thewicg proposal should be now the expected behaviour:
It is recommended that the text fragment be displayed in the location bar’s URL even if a match wasn’t located in the document.
Provide environment information
Node.js v24.7.0Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020 Available memory (MB): 32768 Available CPU cores: 12Binaries: Node: 24.7.0 npm: 11.5.1 Yarn: 1.22.22 pnpm: N/ARelevant Packages: next: 15.5.4 // Latest available version is detected (15.5.4). eslint-config-next: N/A react: 19.2.0 react-dom: 19.2.0 typescript: 5.9.3Next.js Config: output:export
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
This feature works well with multiple different sites, here are some examples
- https://yle.fi/#:~:text=Suosituimmat
- https://www.audible.co.uk/#:~:text=listening
- https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#:~:text=human
- https://en.wikipedia.org/wiki/React_(software)#:~:text=React%20can%20be%20used%20to
But also are sites where this text is stripped..