diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 5769c2b..590da4e 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -961,9 +961,9 @@ $(function() { } // 符合規範:圖文並存時,圖片 alt 應為空值 - if ($img.length > 0) { - $img.attr('alt', ''); - } + // if ($img.length > 0) { + // $img.attr('alt', ''); + // } } // 5. 最終清理 @@ -980,22 +980,22 @@ $(function() { setTimeout(fixAccessibilityAll, 500); }); - if (location.href.search('editmode=on') === -1) { - // 1. 處理圖片 alt 重複問題 (保持原邏輯但優化) - $('a').has('img').each(function () { - const $link = $(this); - const linkText = $link.text().trim(); + // if (location.href.search('editmode=on') === -1) { + // // 1. 處理圖片 alt 重複問題 (保持原邏輯但優化) + // $('a').has('img').each(function () { + // const $link = $(this); + // const linkText = $link.text().trim(); - $link.find('img').each(function () { - const $img = $(this); - const altText = $img.attr('alt')?.trim(); + // $link.find('img').each(function () { + // const $img = $(this); + // const altText = $img.attr('alt')?.trim(); - if (altText && altText === linkText) { - $img.attr('alt', ''); - } - }); - }); - } + // if (altText && altText === linkText) { + // $img.attr('alt', ''); + // } + // }); + // }); + // } $(function() { function smartFixIcons() { $('i').each(function() {