From 376a1bb93883dccad08bd9a6d416cab9640cebeb Mon Sep 17 00:00:00 2001 From: Ricardo Date: Mon, 23 Feb 2026 13:45:44 +0100 Subject: [PATCH] fix: bio formatting for remote profiles (hashtags/mentions inline) Override upstream .mention { display: grid } that broke Mastodon's hashtag/mention HTML in profile bios. Fixes both admin reader (.ap-profile__bio) and public profile (.ap-pub__bio) views. --- assets/reader.css | 34 ++++++++++++++++++++++++++++ package.json | 2 +- views/activitypub-public-profile.njk | 11 +++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/assets/reader.css b/assets/reader.css index 435e8ff..33f6624 100644 --- a/assets/reader.css +++ b/assets/reader.css @@ -993,6 +993,40 @@ color: var(--color-primary); } +/* Override upstream .mention { display: grid } for bio content */ +.ap-profile__bio .h-card { + display: inline; +} + +.ap-profile__bio .h-card a, +.ap-profile__bio a.u-url.mention { + display: inline; + white-space: nowrap; +} + +.ap-profile__bio .h-card a span, +.ap-profile__bio a.u-url.mention span { + display: inline; +} + +.ap-profile__bio a.mention.hashtag { + display: inline; + white-space: nowrap; +} + +.ap-profile__bio a.mention.hashtag span { + display: inline; +} + +/* Mastodon invisible/ellipsis spans for long URLs in bios */ +.ap-profile__bio .invisible { + display: none; +} + +.ap-profile__bio .ellipsis::after { + content: "…"; +} + .ap-profile__actions { display: flex; flex-wrap: wrap; diff --git a/package.json b/package.json index c553e25..ac0718e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.0.9", + "version": "2.0.10", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit", diff --git a/views/activitypub-public-profile.njk b/views/activitypub-public-profile.njk index 4e6e7bd..88263a9 100644 --- a/views/activitypub-public-profile.njk +++ b/views/activitypub-public-profile.njk @@ -177,6 +177,17 @@ .ap-pub__bio p { margin: 0 0 var(--space-s); } .ap-pub__bio p:last-child { margin-bottom: 0; } + /* Mastodon mention/hashtag formatting */ + .ap-pub__bio .h-card { display: inline; } + .ap-pub__bio .h-card a, + .ap-pub__bio a.u-url.mention { display: inline; white-space: nowrap; } + .ap-pub__bio .h-card a span, + .ap-pub__bio a.u-url.mention span { display: inline; } + .ap-pub__bio a.mention.hashtag { display: inline; white-space: nowrap; } + .ap-pub__bio a.mention.hashtag span { display: inline; } + .ap-pub__bio .invisible { display: none; } + .ap-pub__bio .ellipsis::after { content: "…"; } + /* ================================================================ Profile fields ================================================================ */