diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 189f8a6b888..5d1ee8e3704 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,12 +42,21 @@ On the other hand, we want to especially keep: In between these clear-cut categories, there is some gray area. Please feel free to open an issue if you think something is being included that shouldn't be, or is being excluded but should be kept. -## Source formatting +## Style guide -Due to the long legacy of the existing text the guidelines below are not always applied. We do require that you apply the guidelines when making changes, though are happy to provide assistance if this proves to be a blocker to you. +The HTML Standard generally follows style conventions listed in the [Infra Standard](https://infra.spec.whatwg.org) and the [WHATWG style guide](https://whatwg.org/style-guide). Additionally, the HTML Standard follows some specific style conventions not captured by those documents, that we enumerate below. + +Due to the long legacy of the existing text, these guidelines are not always applied. We do require that you apply the guidelines when making changes, though we are happy to provide assistance if this proves to be a blocker to you. + +### Source formatting + + +#### Line wrapping length Use a column width of 100 characters and add newlines where whitespace is used. (Emacs, set `fill-column` to `100`; in Vim, set `textwidth` to `100`; and in Sublime, set `wrap_width` to `100`. Alternatively, wrap the paragraph(s) with your changes with https://domenic.github.io/rewrapper/. Make sure that `column length to rewrap` is set to 100.) +#### Wrapping opportunities + Using newlines between "inline" element tag names and their content is forbidden. (This actually alters the content, by adding spaces.) That is, ```html
` element inside it, unless it's a child of `
Foo.
If (all|any) of the following are true:
+ +condition 1;
condition 2;
condition 3; (and|or)
condition 4,
then…
+Baz.