変更行を検知して文頭を整えるUserScript
code:script.js
(() => {
function checkLines () {
for (const line of scrapbox.Page.lines) {
if ((line.updated - (Date.now() / 1000)) >= 0) {
//line.text.replace(/^\s*/g, s => s.replace(/\s/g, '\t'));
return 'wawawa';
console.log(${line.text} changed.);
}
}
}
if (scrapbox.Layout === 'page') checkLines();
scrapbox.on('lines:changed', checkLines);
})()