-
Notifications
You must be signed in to change notification settings - Fork 23.2k
URL: hash property percent encoding #37165
Copy link
Copy link
Closed
Labels
Content:WebAPIWeb API docsWeb API docsaccepting PRFeel free to open a PR to resolve this issueFeel free to open a PR to resolve this issuearea: URL/URLPattern
Description
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/URL/hash
What specific section or headline is this issue about?
Main section
What information was incorrect, unhelpful, or incomplete?
The fragment is not percent-encoded.
This is not true.
What did you expect to see?
The fragment is percent-encoded plus some examples like:
const url = new URL(
"https://developer.mozilla.org/en-US/docs/Web/API/URL/href#example one",
);
console.log(url.hash); // '#example%20one'The original spoke about percent decoding, hard to know what the motivation was, but possibly:
const url = new URL(
"https://developer.mozilla.org/en-US/docs/Web/API/URL/href#example%20one",
);
console.log(url.hash); // NOT '#example one'?
console.log(url.hash); // '#example%20one'Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/api/url/hash - MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/URL/hash
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/url/hash/index.md
- Last commit: a2847ff
- Document last modified: 2024-07-18T19:25:04.000Z
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Content:WebAPIWeb API docsWeb API docsaccepting PRFeel free to open a PR to resolve this issueFeel free to open a PR to resolve this issuearea: URL/URLPattern