(blog) display just collective as author in case additional words follow it

This commit is contained in:
Valentyne Stigloher 2024-07-26 20:19:09 +02:00
parent 777680044c
commit b8c3a4a221

View File

@ -44,6 +44,10 @@ router.get('/blog', handleErrorAsync(async (req, res) => {
[, date, authorsRaw] = content[1].match(/^<small>(\d\d\d\d-\d\d-\d\d) \| ([^|]*).*<\/small>$/)!;
authors = authorsRaw.split(',').map((a) => {
a = a.trim();
const teamName = global.config.contact.team?.route;
if (teamName && a.startsWith(teamName)) {
return teamName;
}
const m = a.match(/^\[([^\]]+)]/);
if (m) {
return m[1];