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", "type": "tildefriends-app",
"emoji": "🐌", "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) { function linkNode(text, link) {
const linkNode = new commonmark.Node('link', undefined); const linkNode = new commonmark.Node('link', undefined);
if (link.startsWith('#')) { if (link.startsWith('#')) {
linkNode.destination = `#q=${encodeURIComponent(link)}`; linkNode.destination = `#${encodeURIComponent('#' + link)}`;
} else { } else {
linkNode.destination = link; linkNode.destination = link;
} }

View File

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

View File

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