Conversation
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
force-pushed
the
feat/syndicator-bluesky-link-facets
branch
from
September 13, 2026 11:18
9e42980 to
77a981e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 returnsapp.bsky.richtext.facet#linkfacets 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 forcontent.html. The URL thathtmlToStatusTextappends is unchanged, so a post now carries both the clickable text and the trailing URL.Verified locally:
node --test packages/syndicator-bluesky/test/**/*.js51/51, eslint and prettier clean.