From 5c2fd09f8f59e2e8e24946c254868e7eb5220232 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sat, 28 Feb 2026 18:21:32 +0100 Subject: [PATCH] fix: normalize category to array in my-profile controller When a post has a single category, Indiekit stores it as a string (e.g. "Fraude") rather than an array. Nunjucks iterates strings character by character, producing hashtag pills like #F #r #a #u #d #e. --- lib/controllers/my-profile.js | 6 +++++- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/controllers/my-profile.js b/lib/controllers/my-profile.js index d4bb79c..ade8ade 100644 --- a/lib/controllers/my-profile.js +++ b/lib/controllers/my-profile.js @@ -38,7 +38,11 @@ function postToCardItem(post, profile) { photo: profile?.icon || "", }, photo, - category: props.category || [], + category: Array.isArray(props.category) + ? props.category + : props.category + ? [props.category] + : [], }; } diff --git a/package-lock.json b/package-lock.json index 0ed614d..91815f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.1.1", + "version": "2.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.1.1", + "version": "2.1.2", "license": "MIT", "dependencies": { "@fedify/debugger": "^2.0.0", diff --git a/package.json b/package.json index cdb81dd..e100a7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.1.1", + "version": "2.1.2", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",