2022-05-11 17:01:22 +00:00
|
|
|
# Filter false positives from the .messages entry of Nu Validator output
|
|
|
|
.messages |= map(
|
|
|
|
. | select(
|
|
|
|
.type == "error" and
|
|
|
|
(
|
|
|
|
( # See https://github.com/w3c/css-validator/issues/361
|
|
|
|
.message == "CSS: Parse Error."
|
2022-05-13 03:51:11 +00:00
|
|
|
and .extract == "){outline:none}}@media(prefers"
|
2022-05-11 17:01:22 +00:00
|
|
|
and .hiliteLength == 1
|
|
|
|
)
|
|
|
|
or
|
|
|
|
( # See https://github.com/validator/validator/issues/1166
|
|
|
|
.message == "Attribute “media” not allowed on element “meta” at this point."
|
|
|
|
and (.extract | test(" name=\"theme-color\""))
|
|
|
|
)
|
2022-06-09 18:13:25 +00:00
|
|
|
or
|
2022-06-25 22:25:14 +00:00
|
|
|
( # the search page has raw templates, let those slide. I validate the final dynamic search page manually.
|
2022-06-09 18:13:25 +00:00
|
|
|
(.url | test ("/search/index."))
|
|
|
|
and (
|
|
|
|
(.message == "Text not allowed in element “ol” in this context.")
|
|
|
|
or
|
|
|
|
(.message == "Bad value “{{ .URL }}” for attribute “href” on element “a”: Illegal character in path segment: “{” is not allowed.")
|
2022-06-09 00:14:39 +00:00
|
|
|
or
|
|
|
|
(.message == "Bad value “{{ .URL }}” for attribute “cite” on element “q”: Illegal character in path segment: “{” is not allowed.")
|
2022-06-09 18:13:25 +00:00
|
|
|
)
|
|
|
|
and (
|
|
|
|
(.extract | test("{{"))
|
|
|
|
or
|
|
|
|
(.extract | test("}}"))
|
|
|
|
)
|
|
|
|
)
|
2022-05-11 17:01:22 +00:00
|
|
|
) | not
|
|
|
|
)
|
2022-06-03 00:18:13 +00:00
|
|
|
) | del(..|select(. == [])) | del(..|select(. == {})) | select(. != null)
|