Yoshi
code:script.js
scrapbox.PopupMenu.addButton({
title: 'DeepL',
onClick: text => {
if( text.match(/^\[\S*\]$/g) ){ text = text.replace(/\[/g, '');
}else{
text = text.replace(/\[\S*\s/g, ''); }
text = text.replace(/\]/g, '').replace(/^\s+/, '');
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
+ text
)
} else {
+ text
)
}
}
})