Custom functions for pokutuna/chrome-cocopy.
({title, url}) => `[${title.replace(/\s*[\[\]]\s*/g, ' ')} ${url}]`;Rich text format (pastable on slack)
({ title, url }) => {
if (url.startsWith("https://www.yuhikaku.co.jp/books/detail/")) {
const five = url.substring(url.indexOf("9784641")).substring(7).substring(0, 5);
title = five + "『" + title.substring(0, title.indexOf(" | ")) + "』";
}
return {
html: render(`<a href="${url}">${title}</a>`),
text: title,
};
};