Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 更改copilot增加内容 #415

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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