script.jsscrapbox.PopupMenu.addButton({
title: 'illust',
onClick: text => {
if( text.match(/^\[[\S]*\]$/g) ){
text = text.replace(/\[/g, '');
}else{
text = text.replace(/\[[\S]*/g, '');
}
text = text.replace(/\]/g, '').replace(/^\s+/, '');
let uri = encodeURI(text.replace(' ', '+'));
window.open(`https://www.irasutoya.com/search?q=${uri}`);
}
})