diff --git a/build/render.mjs b/build/render.mjs index 8839d58..19b6555 100644 --- a/build/render.mjs +++ b/build/render.mjs @@ -124,6 +124,20 @@ const ASSET_QUERY = /(assets\/(?:vendor\/bootstrap-icons\/bootstrap-icons\.css|c A non-greedy match on would work on the empty shell but not on an already-built file, where the header contains nested divs of its own -- so the build has to be greedy here to stay idempotent. */ +/* Trailing whitespace on generated lines, removed at the point of writing. + + Template literals indent their blank lines along with everything else, so + the rendered pages carry a few hundred lines that are nothing but spaces. + Harmless to a browser, and `git diff --check` flags each one as it enters a + diff, which puts noise in front of every reviewer of every change that + happens to shift those lines. + + Applied to the site's own pages only. The offline Workshop artifact is + written separately and deliberately untouched: its bytes are published as a + SHA-256 and signed by an attestation, so "harmless formatting" is exactly + the kind of change that must not reach it. */ +const tidy = html => html.replace(/[ \t]+$/gm, ''); + const SHELL = /