mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +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)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -47,9 +47,10 @@ window.addEventListener('load', () => {
|
||||
.then(str => new window.DOMParser().parseFromString(str, 'text/xml'))
|
||||
.then(data => {
|
||||
const datas = [...data.querySelectorAll('entry')].map(function (item) {
|
||||
const content = item.querySelector('content')
|
||||
return {
|
||||
title: item.querySelector('title').textContent,
|
||||
content: item.querySelector('content').textContent,
|
||||
content: content ? content.textContent : '',
|
||||
url: item.querySelector('url').textContent
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user