1export const detailIndex = () => { 2 // æ¢åã® ul è¦ç´ ãåå¾ 3 const navList = document.querySelector(".detailIndex-list"); 4 if (navList) { 5 // .detailArticle-body å ã® h2 è¦ç´ ãåå¾ 6 const contents = document.querySelectorAll(".detailArticle-body h2"); 7 contents.forEach((content, index) => { 8 // ã«ã¦ã³ã¿ã使ã£ã¦ä¸æã® ID ãçæ 9 const id = "anc" + (index + 1); 10 // h2 è¦ç´ ã« ID 屿§ãè¨å® 11 content.setAttribute("id", id); 12 // h2 è¦ç´ ã®ããã¹ããåå¾ 13 const text = content.textContent; 14 // æ°ãã li è¦ç´ ã使 15 const listItem = document.createElement("li"); 16 listItem.className = "detailIndex-list-item"; 17 // æ°ãã a è¦ç´ ï¼ã¢ã³ã«ã¼ãªã³ã¯ï¼ã使 18 const link = document.createElement("a"); 19 link.href = "#" + id; // ã¢ã³ã«ã¼ãªã³ã¯ã®ãªã³ã¯å ãè¨å® 20 link.className = "detailIndex-list-item-link"; 21 link.textContent = text; 22 // a è¦ç´ ã li è¦ç´ ã«è¿½å 23 listItem.appendChild(link); 24 // li è¦ç´ ãæ¢åã® ul è¦ç´ ã«è¿½å 25 navList.appendChild(listItem); 26 }); 27 } 28}; 29
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.