Skip to content

Commit

Permalink
Fix aspect ratio check for hero images
Browse files Browse the repository at this point in the history
  • Loading branch information
sippsolutions committed Sep 27, 2024
1 parent 418d48e commit 53e08b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function buildSidebarAndHero(main) {
/* workaround for not existing h1 */
if (!headline && picture) {
const img = picture.querySelector('img');
if (img?.width > img?.height) {
if (img?.width > 2 * img?.height) {

Check failure on line 110 in scripts/scripts.js

View workflow job for this annotation

GitHub Actions / build

Unsafe arithmetic operation on optional chaining. It can result in NaN
headline = main.querySelector('h2');
}
}
Expand Down

0 comments on commit 53e08b1

Please sign in to comment.