From b506451bbe1c749b8fb666ef74b38d910cebc0c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me> Date: Fri, 13 Oct 2023 17:45:05 -0400 Subject: [PATCH] Fixed images to avatars with urls but where the image link was broken. --- CHANGELOG.md | 2 ++ api/activitypub-html/render.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d74cc305..0fdf84492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ pointing to the main user. * In the comment section for a page if a user doesnt have a profile picture setup it will now default to a generic avatar rather than render text. +* Removed image alt text when rendering page comments. If an image profile link + wqs broken the rendered text would not look right. ## 1.0.1 diff --git a/api/activitypub-html/render.ts b/api/activitypub-html/render.ts index 1bc1b74dd..52f6944be 100644 --- a/api/activitypub-html/render.ts +++ b/api/activitypub-html/render.ts @@ -121,7 +121,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { if( actor.icon != undefined) { actor_icon_url = actor.icon.url; } - return `<a title="${escapeHTML(actor.name)}" href="${escapeHTML(actor.url)}" target="_parent" rel="nofollow"><img class="profile" src="${escapeHTML(actor_icon_url)}" alt="The profile picture of ${escapeHTML(actor.name)}"></a>`; + return `<a title="${escapeHTML(actor.name)}" href="${escapeHTML(actor.url)}" target="_parent" rel="nofollow"><img class="profile" src="${escapeHTML(actor_icon_url)}"></a>`; } else { return ""; } @@ -139,7 +139,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { if( actor.icon != undefined) { actor_icon_url = actor.icon.url; } - return `<a title="${escapeHTML(actor.name)}" href="${escapeHTML(actor.url)}" target="_parent" rel="nofollow"><img class="profile" src="${escapeHTML(actor_icon_url)}" alt="The profile picture of ${escapeHTML(actor.name)}"></a>`; + return `<a title="${escapeHTML(actor.name)}" href="${escapeHTML(actor.url)}" target="_parent" rel="nofollow"><img class="profile" src="${escapeHTML(actor_icon_url)}"></a>`; } else { return ""; } @@ -158,7 +158,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { actor_icon_url = actor.icon.url; } return `<div class="reply"> - <p><a title="${escapeHTML(actor.name)}" href="${escapeHTML(actor.url)}" target="_parent" rel="nofollow"><img class="profile" src="${escapeHTML(actor_icon_url)}" alt="The profile picture of ${escapeHTML(actor.name)}"></a>${escapeHTML(actor.name)} wrote: <blockquote>${escapeHTML(stripHTML(object.content))}</blockquote></p> + <p><a title="${escapeHTML(actor.name)}" href="${escapeHTML(actor.url)}" target="_parent" rel="nofollow"><img class="profile" src="${escapeHTML(actor_icon_url)}"></a>${escapeHTML(actor.name)} wrote: <blockquote>${escapeHTML(stripHTML(object.content))}</blockquote></p> </div>` } else { -- GitLab