Skip to content

feat(syndicator-bluesky): make link text in post content clickable - #949

Open
rmdes wants to merge 1 commit into
mainfrom
feat/syndicator-bluesky-link-facets
Open

rmdes wants to merge 1 commit into
mainfrom
feat/syndicator-bluesky-link-facets

Conversation

@rmdes

@rmdes rmdes commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #948.

  • getHtmlLinks(html) returns { text, url } for each absolute <a href>, with inline markup stripped from the text.
  • getLinkFacets(text, links) finds each link text in the post text (in order, so repeated text maps to successive links), skips text that is itself the URL, and returns app.bsky.richtext.facet#link facets with byte offsets.
  • createRichText(client, text, facets) merges them with the detected facets, dropping any that overlap one Bluesky found itself, sorted by offset.
  • post() and the quote-post path pass the facets for content.html. The URL that htmlToStatusText appends is unchanged, so a post now carries both the clickable text and the trailing URL.
  • Tests: unit tests for both helpers (relative links skipped, nested tags, multi-byte offsets, repeated text, URL-as-text) and for the merge; a test-network case asserts the created record has facets for both “cheese” (bytes 7–13) and the appended URL (15–37).

Verified locally: node --test packages/syndicator-bluesky/test/**/*.js 51/51, eslint and prettier clean.

@rmdes rmdes added the plugin-endpoint Endpoint plug-in label Sep 7, 2026
Add a link facet for each HTML link whose text appears in the post
text, using byte offsets, and merge them with the facets Bluesky
detects, skipping any that overlap.

Fixes #948
@rmdes
rmdes force-pushed the feat/syndicator-bluesky-link-facets branch from 9e42980 to 77a981e Compare September 13, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin-endpoint Endpoint plug-in

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link text in a post’s HTML isn’t clickable on Bluesky

1 participant