Skip to content

Commit 66a7dbc

Browse files
authored
Correct error messages (include the related image tag) (#563)
1 parent a861b7d commit 66a7dbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

website/validate-document.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ const checkImageDimensions = async (imageTag, imagePath, cssWidth, cssHeight, dp
5050
const { width, height } = imageMetaData;
5151

5252
if (cssWidth != null && cssWidth !== Math.trunc(width * 96 / dpi)) {
53-
errors.push(['warn', `The relation \`CSS width = image width in pixels * 96 / DPI\` is not satisfied. CSS width specified via attribute (width="...") = ${cssWidth}, image width in pixels = ${width}, DPI = ${dpi}.`]);
53+
errors.push(['warn', `The relation \`CSS width = image width in pixels * 96 / DPI\` is not satisfied in ${imageTag}. CSS width specified via attribute (width="...") = ${cssWidth}, image width in pixels = ${width}, DPI = ${dpi}.`]);
5454
}
5555

5656
if (cssHeight != null && cssHeight !== Math.trunc(height * 96 / dpi)) {
57-
errors.push(['warn', `The relation \`CSS height = image height in pixels * 96 / DPI\` is not satisfied. CSS height specified via attribute (height="...") = ${cssHeight}, image height in pixels = ${height}, DPI = ${dpi}.`]);
57+
errors.push(['warn', `The relation \`CSS height = image height in pixels * 96 / DPI\` is not satisfied in ${imageTag}. CSS height specified via attribute (height="...") = ${cssHeight}, image height in pixels = ${height}, DPI = ${dpi}.`]);
5858
}
5959
}
6060

0 commit comments

Comments
 (0)