Skip to content

Instantly share code, notes, and snippets.

View knu's full-sized avatar

Akinori Musha knu

  • Tokyo, Japan
  • 15:32 (UTC +09:00)
  • X @knu
View GitHub Profile
// ============================================================ //
// Inside of PRESERVE area.
// ============================================================ //
function transposeSubString(input, beg, end, to) {
let txt = input.value;
let head = txt.slice(0, beg);
let left = txt.slice(beg, end);
let right = txt.slice(end, to);
// ==UserScript==
// @name mltag
// @namespace http://jarp.does.notwork.org/userscripts
// @description Looks for things in the page that look like ML-tags but aren't hyperlinked, and converts them to clickable links.
// @include *
// ==/UserScript==
(function () {
const urlRegex = /\[(ruby[\w\-]+):0*(\d+)\]/ig;