Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
with:
fetch-depth: 2
path: 'source'
- name: Check Formatting
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
cargo install reformahtml
mkdir tmp
reformahtml source/source tmp/reformatted-source
diff source/source tmp/reformatted-source > tmp/diff_output.txt || true
if [ -s tmp/diff_output.txt ]; then
cat tmp/diff_output.txt
exit 1
fi
- name: Build
run: |
mkdir output
Expand Down
33 changes: 6 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,9 @@ Due to the long legacy of the existing text, these guidelines are not always app

#### 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.)
Do not wrap text within a paragraph (or list item, etc.). Custom wrapping for readability (e.g. one `code` element per line) is OK; add a `data-noreformat` attribute on the containing element.

#### 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
<dd><span>Parse error</span>. Create a new DOCTYPE token. Set its <i data-x="force-quirks
flag">force-quirks flag</i> to …
```
is fine and
```html
<dd><span>Parse error</span>. Create a new DOCTYPE token. Set its <i data-x="force-quirks flag">
force-quirks flag</i> to …
```
is not.

Using newlines between attributes and inside attribute values that contain whitespace is allowed. Always wrap after putting the maximum number of characters on a single line within these guidelines.

```html
<p>A <code>base</code> element that is the first <code>base</code> element with an <code
data-x="attr-base-href">href</code> content attribute <span>in a document tree</span> has a
```
You can run https://github.com/zcorpan/reformahtml locally to remove inter-paragraph line wrapping. This script is also run as a GitHub workflow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can run https://github.com/zcorpan/reformahtml locally to remove inter-paragraph line wrapping. This script is also run as a GitHub workflow.
You can run https://github.com/zcorpan/reformahtml locally to remove intra-paragraph line wrapping. This script is also run as a GitHub workflow.


### Element hierarchy

Expand All @@ -92,22 +73,20 @@ and the previous list item. No extra newline at the start or end of the list tho

If a "block" element contains a single "block" element, do not put it on a new line.

Do not indent for anything except a new "block" element. For instance
For instance
```html
<li><p>Let <var>corsAttributeState</var> be the current state of the element's <code
data-x="attr-link-crossorigin">crossorigin</code> content attribute.</p></li>
<li><p>Let <var>corsAttributeState</var> be the current state of the element's <code data-x="attr-link-crossorigin">crossorigin</code> content attribute.</p></li>
```
is not indented, but
```html
<li>
<p>For each <var>element</var> in <var>candidate elements</var>, run the following
substeps:</p>
<p>For each <var>element</var> in <var>candidate elements</var>, run the following substeps:</p>

<ol>
```
is.

End tags must not be omitted (except where it is consistent to do so) and attribute values must be quoted (use double quotes).
End tags must not be omitted (except where it is consistent to do so) and non-empty attribute values must be quoted (use double quotes).

### Algorithms

Expand Down
Loading