feat: make internal app URLs permalinks (#329)
This commit is contained in:
parent
4f8f2ed1f1
commit
eb022c92e8
19 changed files with 99 additions and 51 deletions
|
@ -18,15 +18,14 @@ function handleMention(el: Element) {
|
|||
const matchUser = href.value.match(UserLinkRE)
|
||||
if (matchUser) {
|
||||
const [, server, username] = matchUser
|
||||
// Handles need to ignore server subdomains
|
||||
const handle = `@${username}@${server.replace(/(.+\.)(.+\..+)/, '$2')}`
|
||||
href.value = `/${handle}`
|
||||
href.value = `/${server}/@${username}`
|
||||
return h(AccountHoverWrapper, { handle, class: 'inline-block' }, () => nodeToVNode(el))
|
||||
}
|
||||
const matchTag = href.value.match(TagLinkRE)
|
||||
if (matchTag) {
|
||||
const [, , name] = matchTag
|
||||
href.value = `/tags/${name}`
|
||||
href.value = `/${currentServer.value}/tags/${name}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue