File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121 - name : Validate HTML
2222 run : |
23+ set +e
2324 docker run --rm -v "$PWD:/site" ghcr.io/validator/validator:latest \
2425 vnu --errors-only --skip-non-html --format json /site/snapshot.html \
25- | tee $CHECK_DIR/html-validation.json
26+ > $CHECK_DIR/html-validation.json
27+ status=$?
28+ set -e
29+
30+ jq -r '
31+ if (.messages|length==0) then "Geen HTML-validatiefouten."
32+ else
33+ .messages[]
34+ | "[\(.type|ascii_upcase)] regel \(.lastLine // \"?\"):\(.lastColumn // \"?\") - \((.message // \"\") | gsub(\"\\s+\";\" \"))"
35+ end
36+ ' $CHECK_DIR/html-validation.json | tee $CHECK_DIR/html-validation.log
37+
38+ jq -r '
39+ def esc: gsub("%";"%25") | gsub("\r";"%0D") | gsub("\n";"%0A");
40+ if (.messages|length>0) then
41+ .messages[]
42+ | "::error file=snapshot.html,line=\(.lastLine // 1),col=\(.lastColumn // 1)::[\(.type|ascii_upcase)] \((.message // \"\") | esc)"
43+ else empty end
44+ ' $CHECK_DIR/html-validation.json
45+
46+ if [ "$status" -ne 0 ]; then
47+ echo "HTML validatie gaf fouten. Zie annotaties hierboven en $CHECK_DIR/html-validation.log"
48+ exit $status
49+ fi
2650
2751 - name : Check for alternateFormats via Node
2852 id : config
@@ -132,4 +156,4 @@ jobs:
132156 static/*.pdf
133157 media/**/*
134158 js/**/*
135- data/**/*
159+ data/**/*
You can’t perform that action at this time.
0 commit comments