Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
fix: better handling resize
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jan 3, 2024
1 parent ad9d2c9 commit 2c99193
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/js/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ for (const i of document.querySelectorAll("img")) {
i.alt = alt.replace(partReg, "");
}
}
} else if (alt !== i.title && alt.match(/^\d+(x\d+)?|\|\d+(x\d+)/g)) {
const size = getHeightWidth(alt, i.width, i.height);
i.width = size[0] > 0 ? size[0] : i.width;
i.height = size[1] > 0 ? size[1] : i.height;
i.alt = alt.replace(/^\d+(x\d+)?|\|\d+(x\d+)?/gi, "");
}
}

Expand Down

0 comments on commit 2c99193

Please sign in to comment.