Snuke? Smeke?

Highlight "すぬけ" and "すめけ".

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Snuke? Smeke?
// @namespace    https://github.com/morioprog
// @version      1.0
// @description  Highlight "すぬけ" and "すめけ".
// @author       morio__
// @match        https://atcoder.jp/contests/*/tasks/*
// @match        https://*.contest.atcoder.jp/tasks/*
/* load jQuery */
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    const Background = 1;
    const Text = 2;
    // --------ハイライト方法の設定--------
    // Background : 背景色を変更
    // Text       : 文字色を変更
    const Mode = Background;
    var Highlights = [
        ["すぬけ", "snuke", "#FF7F50"],
        ["すめけ", "smeke", "#87CEFA"]
    ];
    // ---------------------------------
    var template = "<span style='";
    switch (Mode) {
      case Background:
            template += "background-color";
            break;
      case Text:
            template += "color";
            break;
      default:
            break;
    }
    $("p,li").each(function() {
      var statement = $(this).html();
      Highlights.forEach(function(highlight) {
        var after = template + ":" + highlight[2] + "'>" + highlight[0] + "</span>";
        statement = statement.replace(new RegExp(highlight[0], "g"), after);
      });
      $(this).html(statement);
    });
})();