BlogsMarks - Convert URL text to Link

In Mark description, convert plain text URLs to links (URLs into HTML hyperlinks that are clickable)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         BlogsMarks - Convert URL text to Link
// @namespace    https://blogmarks.net
// @version      0.2
// @description  In Mark description, convert plain text URLs to links (URLs into HTML hyperlinks that are clickable)
// @author       Decembre
// @icon         https://icons.iconarchive.com/icons/sicons/basic-round-social/48/blogmarks-icon.png
// @match        https://blogmarks.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var urlRegex = /(https?:\/\/[^\s]+)/g;
    var elements = document.querySelectorAll('.b .description');

    elements.forEach(function(element) {
        element.innerHTML = element.innerHTML.replace(urlRegex, function(url) {
            return '<a href="' + url + '" target="_blank">' + url + '</a>';
        });
    });
})();