ssb: Make #hashtags direct to channels.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 15m25s

This commit is contained in:
Cory McWilliams 2024-12-01 15:32:35 -05:00
parent effb354d1b
commit 7e7b1c6ee1
4 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🐌",
"previous": "&Hnfvxu/+f8Z3qbbn/6M5+E7ju/Cj6fxg7SEBwlTy23g=.sha256"
"previous": "&rSi+8iIn1Q/dKk4ptu4z8cX2tc3xPvqJBeFkoSpdYvM=.sha256"
}

View File

@ -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;
}

View File

@ -231,7 +231,7 @@ class TfMessageElement extends LitElement {
>${mention.name}</a
>`;
} else if (mention.link?.startsWith('#')) {
return html` <a href=${'#q=' + encodeURIComponent(mention.link)}
return html` <a href=${'#' + encodeURIComponent('#' + mention.link)}
>${mention.link}</a
>`;
} else if (
@ -640,7 +640,7 @@ ${JSON.stringify(content, null, 2)}</pre
<button class="w3-button w3-theme-d1" @click=${this.react}>
React
</button>
${(!content.root && this.message.rowid <= this.channel_unread) ?
${(!content.root && this.message.rowid < this.channel_unread) ?
html`
<button class="w3-button w3-theme-d1" @click=${this.mark_unread}>Mark Unread</button>
` :
@ -814,7 +814,7 @@ ${JSON.stringify(content, null, 2)}</pre
return small_frame(html`
<div>
${content.subscribed ? 'subscribed to' : 'unsubscribed from'}
<a href=${'#q=' + encodeURIComponent('#' + content.channel)}
<a href=${'#' + encodeURIComponent('#' + content.channel)}
>#${content.channel}</a
>
</div>

View File

@ -18,7 +18,7 @@ class TfTagElement extends LitElement {
render() {
let number = this.count ? html` (${this.count})` : undefined;
return html`<a
href="#q=${this.tag}"
href=${'#' + encodeURIComponent(this.tag)}
style="display: inline-block; margin: 3px; border: 1px solid black; background-color: #444; padding: 4px; border-radius: 3px"
>${this.tag}${number}</a
>`;