script.jsscrapbox.TimeStamp.addFormat('[[]YYYY-MM-DD[]]')
scrapbox.TimeStamp.addFormat('[[]YYYY-MM-DD[]] - ')
scrapbox.TimeStamp.addFormat('#YYYY-MM-DD')
scrapbox.TimeStamp.addFormat('[[]YYYY/MM/DD[]]')
scrapbox.TimeStamp.addFormat('[[]YYYY/MM/DD[]] - ')
scrapbox.TimeStamp.addFormat('YYYY-MM-DD')
scrapbox.TimeStamp.addFormat('YYYY/MM/DD')
script.jsscrapbox.PopupMenu.addButton({
title: 'quote',
onClick: text => text.split(/\n/).map(line => ` > ${line}`).join('\n')
})
script.jsscrapbox.PopupMenu.addButton({
title: 'format',
onClick: text => text.split('\n').map(function(line) {
return line.replace(/^\s*/g, s => s.replace(/\s/g, '\t'))
.replace(/[ぁ-ん|ァ-ヴ]゙/g, s => String.fromCharCode(s.charCodeAt(0) + 1))
.replace(/[A-Za-z0-9]/g, s => String.fromCharCode(s.charCodeAt(0) - 0xFEE0))
}).join('\n')
})
script.js// リンクを外す
scrapbox.PopupMenu.addButton({
title: 'unlink',
onClick: text => {
const result = text.split(/\n/)
.map(line => line.replace(/\[([^\[!"#%&'()\*\+,\-\.\/\{\|\}<>_~][^\[\]]*)\]/g,'$1')).join('\n');
// テロメアが無駄に更新されるのを防ぐ
if(text == result) return;
return result;
}
});