Skip to content

Commit

Permalink
fix: remove the comma after collaped or grouped mentions #2464
Browse files Browse the repository at this point in the history
  • Loading branch information
zenghawtin committed Feb 25, 2024
1 parent cadf1b4 commit 1f1ce20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions composables/content-parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ function transformCollapseMentions(status?: mastodon.v1.Status, inReplyToStatus?
if (child.type === TEXT_NODE) {
trimContentStart = () => {
child.value = child.value.trimStart()
// remove the comma after the collapsed mention.
if (child.value.at(0) === ',') {
child.value = child.value.slice(1)
child.value = child.value.trimStart()
}
}
}
// remove <br> after mention
Expand Down
4 changes: 3 additions & 1 deletion composables/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export async function loginTo(masto: ElkMasto, user: Overwrite<UserLogin, { acco

// GoToSocial only API
const url = `https://${user.server}`
fetch(`${url}/nodeinfo/2.0`).then(r => r.json()).then((info) => {
fetch(`${url}/nodeinfo/2.0`, {
mode: 'no-cors',
}).then(r => r.json()).then((info) => {
nodes.value[user.server] = info
}).catch(() => undefined)

Expand Down

0 comments on commit 1f1ce20

Please sign in to comment.