kopia lustrzana https://github.com/nextcloud/social
link at mentions to external profile page
Signed-off-by: Robin Appelman <robin@icewind.nl>pull/1035/head
rodzic
2966545f3e
commit
d41a216c49
|
@ -65,7 +65,7 @@ function transformText(createElement, text) {
|
|||
to: {
|
||||
name: 'profile',
|
||||
params: { account: match[2].substr(1) }
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
[match[3]]
|
||||
|
@ -120,18 +120,12 @@ function cleanLink(createElement, node, context) {
|
|||
case 'mention':
|
||||
var tag = matchMention(context.mentions, node.getAttribute('href'), node.textContent)
|
||||
if (tag) {
|
||||
return createElement(
|
||||
'router-link',
|
||||
{
|
||||
props: {
|
||||
to: {
|
||||
name: 'profile',
|
||||
params: { account: tag.name.substr(1) }
|
||||
}
|
||||
}
|
||||
},
|
||||
[node.textContent]
|
||||
)
|
||||
attributes['rel'] = 'nofollow noopener noreferrer'
|
||||
attributes['target'] = '_blank'
|
||||
attributes['href'] = node.getAttribute('href')
|
||||
attributes['title'] = tag.name
|
||||
|
||||
return createElement('a', { attrs: attributes }, [transformText(createElement, node.textContent)])
|
||||
} else {
|
||||
return transformText(createElement, node.textContent)
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue