PDFを整形するUserScript
PDF整形(スペース改行削除)
code:script.js
scrapbox.PopupMenu.addButton({
title: 'PDF整形',
onClick: text => {
text = text
.replace(/^>\s/g, "")
.replace(/(?<!
A-Za-z
)\n(?!
A-Za-z
)/g, " ")
.replace(/\n/g, "")
.replace(/(?<!
A-Za-z
)\s(?!
A-Za-z
)/g, "")
.replace(/·/g, "・");
return text;
}
})
#UserScript