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

Commit

Permalink
fix: redeclaration of img
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Dec 12, 2023
1 parent 92c8f6c commit 77e5aaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/js/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ function getHeightWidth(alt) {
}

const p_img = /\.+\\/gi;
const img = document.querySelectorAll("img");
for (const i of img) {
for (const i of document.querySelectorAll("img")) {
const regAlt = new RegExp("\\|");
const alt = i.alt;
if (alt.match(regAlt)) {
Expand Down
11 changes: 5 additions & 6 deletions src/js/url_exist.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@ for (const anchor of ht) {
}
}

const img = document.querySelectorAll("img");
for (const image of img) {
if (image.hostname === window.location.hostname) {
var link = parseURL(image, 1);
history = checkIfInternalLinksExists(link.ref, link.title, image, history);
}
for (const image of document.querySelectorAll("img")) {
if (image.hostname === window.location.hostname) {
var link = parseURL(image, 1);
history = checkIfInternalLinksExists(link.ref, link.title, image, history);
}
}

0 comments on commit 77e5aaa

Please sign in to comment.