Commit without whitespace changes on github

后端 未结 4 938
长发绾君心
长发绾君心 2021-01-01 12:06

Is there a way to display a commit on github.com without showing whitespace changes?

Is there a way to display that from console? i.e. clone and then look at commit

4条回答
  •  生来不讨喜
    2021-01-01 12:44

    Sadly the X thing is gone and alongside the previous snippet is rendered useless. Here is something that should work for now:

    var i, e, tr, tdL, tdR, textL, textR, text = function (el) { return el.parentNode.children[2].children[1].children[0].textContent.replace(/\s/g, '').substr(1); }
    for (i = 0, e = document.getElementsByClassName('gd'); i < e.length; ++i) {
        tr = e[i].parentNode.parentNode.parentNode;
        if (' ' !== tr.children[1].innerHTML) { continue; }
        tdL = tr.children[0];
        tdR = document.getElementById(tdL.id.replace(/^L(\d+)L/, 'L$1R')),
        textL = text(tdL);
        textR = text(tdR);
        if (textL === textR) { tdL.parentNode.style.display = tdR.parentNode.style.display = 'none'; }
    }
    

提交回复
热议问题