wy-ei
12/11/2016 - 7:50 AM

build-list.js

(function(){
    let comments = document.querySelectorAll('.js-comment');
    let list = [];

    [].slice.call(comments, 0).forEach(comment => {
        let heads = comment.querySelectorAll('h2');
        let ref = '#' + comment.getAttribute('id');
        if(ref.match(/^#issuecomment/)){
            [].slice.call(heads, 0).forEach(head => {
                list.push(`- [${head.innerHTML}](${ref})`);
            });
        }
    })
    console.log(list.join('\n'));
})();