also check for alt attributes in preview images
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
be03202fd2
commit
d5e1cd31ea
|
@ -362,6 +362,11 @@ for f in $files_all; do
|
|||
RETURN_IMGALT=$((RETURN_IMGALT + 1))
|
||||
FILES_IMGALT="${FILES_IMGALT}|${f}"
|
||||
fi
|
||||
if xmllint --xpath "//image[not(@alt) or string-length(normalize-space(@alt))=0]" "${f}" \
|
||||
&>/dev/null; then
|
||||
RETURN_IMGALT=$((RETURN_IMGALT + 1))
|
||||
FILES_IMGALT="${FILES_IMGALT}|${f}"
|
||||
fi
|
||||
fi
|
||||
|
||||
done
|
||||
|
@ -663,8 +668,9 @@ if [ $RETURN_IMGALT -gt 0 ]; then
|
|||
==========================================
|
||||
|| [WARN] No alternative text for image ||
|
||||
==========================================
|
||||
The following ${RETURN_IMGALT} file(s) in your commit contain images (<img>)
|
||||
that do not contain an "alt" attribute for alternative text:
|
||||
The following ${RETURN_IMGALT} file(s) in your commit contain images
|
||||
(<img> and/or <image>) that do not contain an "alt" attribute for alternative
|
||||
text:
|
||||
|
||||
$(filelisting "${FILES_IMGALT}")
|
||||
|
||||
|
|
Loading…
Reference in New Issue