forked from Mirrors/elk
fix: subdomains should be ignored for user handles
This commit is contained in:
parent
f596973603
commit
2ece5f5619
1 changed files with 2 additions and 1 deletions
|
@ -16,7 +16,8 @@ export function defaultHandle(el: Element) {
|
||||||
const matchUser = href.value.match(UserLinkRE)
|
const matchUser = href.value.match(UserLinkRE)
|
||||||
if (matchUser) {
|
if (matchUser) {
|
||||||
const [, server, username] = matchUser
|
const [, server, username] = matchUser
|
||||||
href.value = `/@${username}@${server}`
|
// Handles need to ignore server subdomains
|
||||||
|
href.value = `/@${username}@${server.replace(/(.+\.)(.+\..+)/, '$2')}`
|
||||||
}
|
}
|
||||||
const matchTag = href.value.match(TagLinkRE)
|
const matchTag = href.value.match(TagLinkRE)
|
||||||
if (matchTag) {
|
if (matchTag) {
|
||||||
|
|
Loading…
Reference in a new issue