From c4dd1e313d4788ee63871cd95ac78850a81bbed3 Mon Sep 17 00:00:00 2001 From: Avris Date: Mon, 13 Sep 2021 20:45:06 +0200 Subject: [PATCH] [banner] remove square brackets from the banner --- server/routes/banner.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/routes/banner.js b/server/routes/banner.js index 8c6158aa..f9257d59 100644 --- a/server/routes/banner.js +++ b/server/routes/banner.js @@ -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); });