From 1a35c861df41452b79aa37baadfc92ac75befa5f Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Fri, 6 Oct 2023 18:22:18 -0700 Subject: [PATCH] Remove trailing whitespace courtesy of html-validate --- content/posts/cli-best-practices.md | 6 ++--- content/posts/website-best-practices.md | 2 +- layouts/partials/webmentions.html | 10 ++++---- linter-configs/htmlvalidate.json | 34 +++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 linter-configs/htmlvalidate.json diff --git a/content/posts/cli-best-practices.md b/content/posts/cli-best-practices.md index da740e7..dfb0e13 100644 --- a/content/posts/cli-best-practices.md +++ b/content/posts/cli-best-practices.md @@ -50,14 +50,14 @@ $ tool --help ║ ║ ╚═════════════════════════════════════════════════════════╝ -Usage: tool [options] +Usage: tool [options] Commands: tool init [directory] creates a new project - tool manage allows you to manage an existing project + tool manage allows you to manage an existing project Options: --help Show help [boolean] - --version Show version number [boolean] + --version Show version number [boolean] ``` {{}} diff --git a/content/posts/website-best-practices.md b/content/posts/website-best-practices.md index 6512312..29e57a6 100644 --- a/content/posts/website-best-practices.md +++ b/content/posts/website-best-practices.md @@ -1540,7 +1540,7 @@ A workaround is to use the "text" ARIA role to remove the semantics of elements. ```figure {str1="text" str2="br"}

Digital accessibility,
- for everyone. + for everyone.

``` diff --git a/layouts/partials/webmentions.html b/layouts/partials/webmentions.html index 549e9cc..6395bc4 100644 --- a/layouts/partials/webmentions.html +++ b/layouts/partials/webmentions.html @@ -87,7 +87,7 @@ {{ $webmention.source | strings.TrimPrefix "https://" | strings.TrimPrefix "www." | strings.TrimRight "/" | truncate 35 -}} {{ end -}} this - {{ else -}} + {{- else -}} {{- if findRE `^https://brid.gy/[^/]*/mastodon` $webmention.source -}} {{- $canonicalSrc := replaceRE "https://brid.gy/.*mastodon/@Seirdy@pleroma.envs.net/([^/]*)(.*)?" `https://pleroma.envs.net/notice/$1` $src -}} @@ -110,8 +110,8 @@ {{- if findRE `^https://brid.gy/[^/]*/mastodon` $webmention.source -}}

This comment may have major formatting errors that could impact screen reader comprehension.

{{- end -}} -

{{ $webmention.content | replaceRE `^@Seirdy(@pleroma.envs.net)? ?` "" | replaceRE ` \n` ` -`}}

+

{{ $webmention.content | replaceRE `^@Seirdy(@pleroma.envs.net)? ?` "" | replaceRE `([ \t]*)?\n*([ \t]*)?` ` +` | trim "\n\t" | chomp}}

{{- end -}} {{- end }} diff --git a/linter-configs/htmlvalidate.json b/linter-configs/htmlvalidate.json new file mode 100644 index 0000000..ae0319a --- /dev/null +++ b/linter-configs/htmlvalidate.json @@ -0,0 +1,34 @@ +{ + "extends": [ + "html-validate:recommended", + "html-validate:standard", + "html-validate:a11y", + "html-validate:document" + ], + "rules": { + "attribute-empty-style": [ + "error", + { + "style": "empty" + } + ], + "attribute-boolean-style": [ + "error", + { + "style": "empty" + } + ], + "void-style": [ + "error", + { + "style": "selfclosing" + } + ], + "require-sri": [ + "off" + ], + "prefer-button": [ + "off" + ] + } +}