Skip to content

Commit

Permalink
Merge pull request #415 from everfu/dev
Browse files Browse the repository at this point in the history
🔥 更改copilot增加内容
  • Loading branch information
everfu authored Nov 10, 2024
2 parents ee125aa + 4795a4f commit 01380d3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions source/js/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
const escapeHtml = (unsafe) => {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
};

const sidebarFn = () => {
const $toggleMenu = document.getElementById('toggle-menu');
const $mobileSidebarMenus = document.getElementById('sidebar-menus');
Expand Down Expand Up @@ -302,7 +293,7 @@ const sco = {
document.querySelectorAll('#article-container img:not(.gallery-item img)').forEach(image => {
const captionText = image.getAttribute('alt');
if (captionText) {
image.insertAdjacentHTML('afterend', `<div class="img-alt is-center">${escapeHtml(captionText)}</div>`);
image.insertAdjacentHTML('afterend', `<div class="img-alt is-center">${utils.escapeHtml(captionText)}</div>`);
}
});
},
Expand Down

0 comments on commit 01380d3

Please sign in to comment.