kennethrapp / Hacker News Text Tweaks

// ==UserScript==
// @name         Hacker News Text Tweaks
// @namespace    http://openuserjs.org/users/kennethrapp
// @copyright 2018, kennethrapp (https://openuserjs.org/users/kennethrapp)
// @license      MIT
// @version      1.0
// @description  Text enhancements for Hacker News
// @author       kenneth rapp
// @match        https://news.ycombinator.com/*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  aeach(function (comment) {
    // unfade all comments
    comment.firstElementChild.setAttribute("class", "c00");

    // highlight inline replies
    var regex = new RegExp('>&gt;(.+?)<', 'gim');
    comment.innerHTML = comment.innerHTML.replace(regex, '><font color="#195708">&gt;$1</font><');

    // tweak the css a smidge
    comment.setAttribute("style", "line-height:150%;text-align: justify;text-justify: inter-word;position:relative;display:inherit;padding-right:3em;padding-left:1em");
  }, allof('comment'));

})();