Added cashtag support for statuses
• Added:
- cashtag support for statuses
Ref: e23931b255
This commit is contained in:
@@ -50,7 +50,7 @@ class StatusContent extends ImmutablePureComponent {
|
||||
link.addEventListener('click', this.onMentionClick.bind(this, mention), false)
|
||||
link.setAttribute('title', mention.get('acct'))
|
||||
link.removeAttribute('target')
|
||||
} else if (link.textContent[0] === '#' || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) {
|
||||
} else if (['#', '$'].includes(link.textContent[0]) || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) {
|
||||
link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false)
|
||||
link.removeAttribute('target')
|
||||
} else {
|
||||
@@ -85,7 +85,7 @@ class StatusContent extends ImmutablePureComponent {
|
||||
}
|
||||
|
||||
onHashtagClick = (hashtag, e) => {
|
||||
hashtag = hashtag.replace(/^#/, '').toLowerCase()
|
||||
hashtag = hashtag.replace(/^(#|\$)/, '').toLowerCase()
|
||||
|
||||
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault()
|
||||
|
||||
Reference in New Issue
Block a user