mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:40:55 +08:00
fix: 修復開啟 photofigcaption 後,導致 inlineImg 標籤外掛顯示錯亂的 bug close #667
fix: 修復使用本地搜索時,搜索插件配置為不搜索文章內容會無法使用搜索的 bug close #666 fix: 修復可能導致相關文章鏈接出錯的 bug close #549 improvement: 調整代碼框滾動條顏色 close #651 improvement: 當圖片沒有 figcaption 時,不會添加 figcaption 代碼
This commit is contained in:
@@ -225,10 +225,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
function addPhotoFigcaption () {
|
||||
document.querySelectorAll('#article-container img').forEach(function (item) {
|
||||
const parentEle = item.parentNode
|
||||
if (!parentEle.parentNode.classList.contains('justified-gallery')) {
|
||||
const altValue = item.alt
|
||||
if (altValue && !parentEle.parentNode.classList.contains('justified-gallery')) {
|
||||
const ele = document.createElement('div')
|
||||
ele.className = 'img-alt is-center'
|
||||
ele.textContent = item.getAttribute('alt')
|
||||
ele.textContent = altValue
|
||||
parentEle.insertBefore(ele, item.nextSibling)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user