feat: enhance image loading and sanitization

- Standardized image loading to lazy for consistency in modal previews
- Expanded allowed attributes for sanitization to support additional image properties
- Introduced an exclusive filter to exclude specific images by class during sanitization
This commit is contained in:
ccbikai
2024-08-10 14:00:53 +08:00
parent 270fac70d4
commit c6fe4742aa
2 changed files with 6 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ function getImages($, item, { staticProxy, id, index, title }) {
<img src="${staticProxy + url}" alt="${title}" loading="${index > 15 ? 'eager' : 'lazy'}" />
</button>
<button class="image-preview-button modal" id="${popoverId}" popovertarget="${popoverId}" popovertargetaction="hide" popover>
<img class="modal-img" src="${staticProxy + url}" alt="${title}" loading="${index > 15 ? 'eager' : 'lazy'}" />
<img class="modal-img" src="${staticProxy + url}" alt="${title}" loading="lazy" />
</button>
`
})?.get()