[banner] remove square brackets from the banner

This commit is contained in:
Avris 2021-09-13 20:45:06 +02:00
parent fd2d5d4c4c
commit c4dd1e313d
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ router.get('/banner/:pronounName*.png', handleErrorAsync(async (req, res) => {
const pronounNameOptions = pronounName === global.config.pronouns.any ? [global.config.pronouns.any] : pronoun.nameOptions();
context.font = `bold ${pronounNameOptions.length <= 2 ? '70' : '36'}pt Quicksand`
context.fillText(pronounNameOptions.join('\n'), width / leftRatio + imageSize / 1.5, height / 2 + (pronounNameOptions.length <= 2 ? 72 : 24));
context.fillText(
pronounNameOptions.map(o => o.replace(/ ?\[[^\]]+] ?/g, '').trim()).join('\n'),
width / leftRatio + imageSize / 1.5,
height / 2 + (pronounNameOptions.length <= 2 ? 72 : 24)
);
return canvas.toBuffer(mime);
});