Scroll To Text Fragment
こういうので動く?(SPAなので、このままだとダメそう
code: script.js
const relatedPageList = document.querySelector('.related-page-list');
const items = relatedPageList.querySelectorAll('li.splitter, li.page-list-item, li.headword')
let currentHeadWord;
items.forEach(item => {
if (item.classList.contains('headword')) currentHeadWord = item.querySelector('.title').textContent
if (!currentHeadWord) return
const anchor = item.querySelector('a')
anchor.href = anchor.href + '#:~:text=' + currentHeadWord
})