fedimbed.bluesky: not all urls get truncated

This commit is contained in:
Cynthia Foxwell 2024-11-20 10:01:09 -07:00
parent 4f9bc956a3
commit 0e4ac6dfa0

View file

@ -159,7 +159,11 @@ function processBlueskyFacets(str, facets) {
for (const feature of part.features) {
switch (feature.$type) {
case "app.bsky.richtext.facet#link": {
if (part.text == feature.uri.replace(/^https?:\/\//, "") || part.text.endsWith("...")) {
if (
part.text === feature.uri ||
part.text === feature.uri.replace(/^https?:\/\//, "") ||
part.text.endsWith("...")
) {
part.text = feature.uri;
} else {
part.text = `[${part.text}](${feature.uri})`;