diff --git a/docs/.vitepress/theme/Twikoo.vue b/docs/.vitepress/theme/Twikoo.vue index 841259b2e..f6b500ad0 100644 --- a/docs/.vitepress/theme/Twikoo.vue +++ b/docs/.vitepress/theme/Twikoo.vue @@ -16,14 +16,17 @@ function initTwikoo () { } function initLightGallery () { - // This function is compiled to ES5 - var commentContents = document.getElementsByClassName('tk-content'); + var commentContents = [ + ...document.getElementsByClassName('vp-doc'), + ...document.getElementsByClassName('tk-content') + ]; for (var i = 0; i < commentContents.length; i++) { var commentItem = commentContents[i]; var imgEls = commentItem.getElementsByTagName('img'); if (imgEls.length > 0) { for (var j = 0; j < imgEls.length; j++) { var imgEl = imgEls[j]; + if (imgEl.parentElement.tagName === 'A') continue; var aEl = document.createElement('a'); aEl.setAttribute('class', 'tk-lg-link'); aEl.setAttribute('href', imgEl.getAttribute('src')); @@ -65,11 +68,11 @@ onMounted(() => { - - + +
- +