From 7e7b1c6ee138085666d8630b7175272b3d332426 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 1 Dec 2024 15:32:35 -0500 Subject: [PATCH] ssb: Make #hashtags direct to channels. --- apps/ssb.json | 2 +- apps/ssb/commonmark-hashtag.js | 2 +- apps/ssb/tf-message.js | 6 +++--- apps/ssb/tf-tag.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 4661196d..92f3946f 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&Hnfvxu/+f8Z3qbbn/6M5+E7ju/Cj6fxg7SEBwlTy23g=.sha256" + "previous": "&rSi+8iIn1Q/dKk4ptu4z8cX2tc3xPvqJBeFkoSpdYvM=.sha256" } diff --git a/apps/ssb/commonmark-hashtag.js b/apps/ssb/commonmark-hashtag.js index 32df77fe..bac1de47 100644 --- a/apps/ssb/commonmark-hashtag.js +++ b/apps/ssb/commonmark-hashtag.js @@ -7,7 +7,7 @@ function textNode(text) { function linkNode(text, link) { const linkNode = new commonmark.Node('link', undefined); if (link.startsWith('#')) { - linkNode.destination = `#q=${encodeURIComponent(link)}`; + linkNode.destination = `#${encodeURIComponent('#' + link)}`; } else { linkNode.destination = link; } diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 3840c1d4..d97a2c5f 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -231,7 +231,7 @@ class TfMessageElement extends LitElement { >${mention.name}`; } else if (mention.link?.startsWith('#')) { - return html` ${mention.link}`; } else if ( @@ -640,7 +640,7 @@ ${JSON.stringify(content, null, 2)} React - ${(!content.root && this.message.rowid <= this.channel_unread) ? + ${(!content.root && this.message.rowid < this.channel_unread) ? html` ` : @@ -814,7 +814,7 @@ ${JSON.stringify(content, null, 2)} ${content.subscribed ? 'subscribed to' : 'unsubscribed from'} - #${content.channel} diff --git a/apps/ssb/tf-tag.js b/apps/ssb/tf-tag.js index 66cb0c8d..91ba388f 100644 --- a/apps/ssb/tf-tag.js +++ b/apps/ssb/tf-tag.js @@ -18,7 +18,7 @@ class TfTagElement extends LitElement { render() { let number = this.count ? html` (${this.count})` : undefined; return html`${this.tag}${number}`;