generated at
scrapbox-url-customizer-2-settings
takkerが使っているscrapbox-url-customizer-2のカスタム変換設定

script.js
const format = text => text .trim().replace(/[\n\r\f]/g, '').replace(' ?[', '[').replace('] ?', ']'); export const config = [

Qiita
script.js
{ match: /https:\/\/qiita\.com/, text: ({url, title, dom, hash}) => { const span = dom.getElementById(hash); if (!span) return `[${url} ${format(title)}]`; const subtitle = span.parentNode.textContent; return `[${url} ${format(subtitle)} | ${format(title)}]`; }, },

github.ioのレポジトリのトップページ
script.js
{ match: /https:\/\/github\.com\/[^\/]+\/[^\/]+\/?$/, text: ({title: title_, url, dom, hash}) => { const title = title_.split(':')[0]; const a = dom.getElementById(`user-content-${hash}`); if (!a) return `[/icons/github.icon][${url} ${format(title)}]`; const subtitle = a.parentNode.textContent; return `[/icons/github.icon][${url} ${format(subtitle)} | ${format(title)}]`; }, },

deno.landのリンク
script.js
{ match: /https:\/\/deno\.land/, text: ({url}) => `[/icons2/deno.icon]${url}`, },

Wikiwand
urlをwikipediaに変更する
script.js
{ match: /https:\/\/www\.wikiwand\.com/, text: ({pureURL, dom, hash}) => { const [_, lang, pageName] = pureURL.match(/www\.wikiwand\.com\/([^\/]+)\/([^\/]+)\/?/); const title = `${pageName} - Wikipedia`; const url = `https://${lang}.wikipedia.org/wiki/${pageName}`; const subtitle = dom.getElementById(`toc_btn_${hash.slice(1)}`)?.textContent; return !subtitle ? `[${url} ${format(title)}]` : `[${url}#${hash.slice(1)} ${format(subtitle)} | ${format(title)}]`; }, },

script.js
{ match: /https:\/\/wikiwiki\.jp\/rage2050/, text: ({title, url, dom, hash}) => { const subtitle = dom.getElementById(hash)?.previousSibling?.textContent; return !subtitle ? `[${url} ${format(title)}]` : `[${url} ${format(subtitle)} | ${format(title)}]`; }, },

script.js
{ match: /https:\/\/note\.com/, text: ({title, url, dom, hash}) => { const subtitle = dom.querySelector(`[name="${hash}"]`)?.firstChild?.textContent; return !subtitle ? `[${url} ${format(title)}]` : `[${url} ${format(subtitle)} | ${format(title)}]`; }, },


#2021-06-05 11:58:36
#2021-05-23 04:51:02
#2021-02-26 00:31:57