Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whatwg/url
URL Standard
https://github.com/whatwg/url
standard url whatwg
Last synced: 12 days ago
JSON representation
URL Standard
- Host: GitHub
- URL: https://github.com/whatwg/url
- Owner: whatwg
- License: other
- Created: 2012-09-19T12:44:40.000Z (about 12 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T15:30:50.000Z (8 months ago)
- Last Synced: 2024-04-14T05:11:14.341Z (7 months ago)
- Topics: standard, url, whatwg
- Language: HTML
- Homepage: https://url.spec.whatwg.org/
- Size: 3.66 MB
- Stars: 502
- Watchers: 83
- Forks: 135
- Open Issues: 82
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
This repository hosts the [URL Standard](https://url.spec.whatwg.org/).
## Code of conduct
We are committed to providing a friendly, safe, and welcoming environment for all. Please read and respect the [Code of Conduct](https://whatwg.org/code-of-conduct).
## Contribution opportunities
Folks notice minor and larger issues with the URL Standard all the time and we'd love your help fixing those. Pull requests for typographical and grammar errors are also most welcome.
Issues labeled ["good first issue"](https://github.com/whatwg/url/labels/good%20first%20issue) are a good place to get a taste for editing the URL Standard. Note that we don't assign issues and there's no reason to ask for availability either, just provide a pull request.
If you are thinking of suggesting a new feature, read through the [FAQ](https://whatwg.org/faq) and [Working Mode](https://whatwg.org/working-mode) documents to get yourself familiarized with the process.
We'd be happy to help you with all of this [on Chat](https://whatwg.org/chat).
## Pull requests
In short, change `url.bs` and submit your patch, with a [good commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md).
Please add your name to the Acknowledgments section in your first pull request, even for trivial fixes. The names are sorted lexicographically.
To ensure your patch meets all the necessary requirements, please also see the [Contributor Guidelines](https://github.com/whatwg/meta/blob/main/CONTRIBUTING.md). Editors of the URL Standard are expected to follow the [Maintainer Guidelines](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md).
## Tests
Tests are an essential part of the standardization process and will need to be created or adjusted as changes to the standard are made. Tests for the URL Standard can be found in the `url/` directory of [`web-platform-tests/wpt`](https://github.com/web-platform-tests/wpt).
A dashboard showing the tests running against browser engines can be seen at [wpt.fyi/results/url](https://wpt.fyi/results/url).
## Building "locally"
For quick local iteration, run `make`; this will use a web service to build the standard, so that you don't have to install anything. See more in the [Contributor Guidelines](https://github.com/whatwg/meta/blob/main/CONTRIBUTING.md#building).
## Formatting
Use a column width of 100 characters.
Do not use newlines inside "inline" elements, even if that means exceeding the column width requirement.
```htmlThe
remove(tokens…)
method, when invoked, must run these steps:
```
is okay and
```htmlThe
remove(tokens…)
method, when
invoked, must run these steps:
```
is not.Using newlines between "inline" element tag names and their content is also forbidden. (This actually alters the content, by adding spaces.) That is
```html
token
```
is fine and
```html
token
```
is not.An `
` element inside it, unless it's a child of `
- `.
-
For each token in tokens, in given order, that is not in
tokens, append token to tokens.
```
is not indented, but
```html-
For each token in tokens, run these substeps:
-
If token is the empty string, throw a {{SyntaxError}} exception.
```
is.End tags may be included (if done consistently) and attributes may be quoted (using double quotes), though the prevalent theme is to omit end tags and not quote attributes (unless they contain a space).
Place one newline between paragraphs (including list elements). Place three newlines before `
`, and two newlines before other headings. This does not apply when a nested heading follows the parent heading.
```htmlDo not place a newline above.
Place a newline above.
Place a newline above.
Place two newlines above.
Placing one newline is OK here.
Place two newlines above.
```
Use camel-case for variable names and "spaced" names for definitions, algorithms, etc.
```htmlA request has an associated
redirect mode,...
```
```htmlLet redirectMode be request's redirect mode.
```## Implementations
A complete JavaScript implementation of the standard can be found at
[jsdom/whatwg-url](https://github.com/jsdom/whatwg-url). This implementation is kept synchronized
with the standard and tests.A complete C++ implementation of the standard can be found at
[ada-url/ada](https://github.com/ada-url/ada). This implementation is kept synchronized
with the standard and tests, and is currently used in [Node.js](https://github.com/nodejs/node).The [Live URL Viewer](https://jsdom.github.io/whatwg-url/) lets you manually test-parse any URL,
comparing your browser's URL parser to that of
[jsdom/whatwg-url](https://github.com/jsdom/whatwg-url).
-
-
If a "block" element contains a single "block" element, do not put it on a newline.
Do not indent for anything except a new "block" element. For instance
```html