Changeset 065452a in Klonkt
- Timestamp:
- 06/24/2026 11:11:29 AM (3 months ago)
- Branches:
- main
- Children:
- 5a93ac0
- Parents:
- dd1028a
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rdd1028a r065452a 101 101 const aId = actorId(base, site.slug); 102 102 const human = `${base}/${encodeURIComponent(post.slug)}`; 103 const html = post.content || ''; // posts store sanitized HTML 103 // Mastodon ignores a Note's `name`, so put the title INTO the content (bold 104 // first line) — the standard blog→fediverse convention. post.content is 105 // already sanitized HTML; the title is plain text, so escape it. 106 const escTitle = String(post.title || '').replace(/[<>&]/g, (c) => ({ '<': '<', '>': '>', '&': '&' }[c])); 107 const titleHtml = post.title ? `<p><strong>${escTitle}</strong></p>` : ''; 108 const html = titleHtml + (post.content || ''); 104 109 return { 105 110 id, … … 107 112 attributedTo: aId, 108 113 content: html, 109 name: post.title || undefined,110 114 url: human, 111 115 published: new Date(post.published_at || post.created_at || Date.now()).toISOString(),
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)