summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2019-07-26 16:04:21 +0200
committerCyrille Bollu <cyrpub@bollu.be>2019-07-26 16:04:21 +0200
commitb35dd395a50aae929d88edc0bbf653f506fde832 (patch)
tree2abc96e683087e3d6c0be8a63547d0eabeb53428
parent18862db660e07c175aea5681e9f4e58eba2e4c3c (diff)
Creates a mangleHashtags() function in TimelinePost.vue
Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
-rw-r--r--src/components/TimelinePost.vue18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/components/TimelinePost.vue b/src/components/TimelinePost.vue
index 5a9079be..99e88c3f 100644
--- a/src/components/TimelinePost.vue
+++ b/src/components/TimelinePost.vue
@@ -102,7 +102,7 @@ export default {
return Date.parse(this.item.published)
},
formatedMessage() {
- let message = this.item.content
+ var message = this.item.content
if (typeof message === 'undefined') {
return ''
}
@@ -114,12 +114,7 @@ export default {
}
}
})
- // Replace hashtag's href parameter with local ones
- const regex = hashtagRegex()
- message = message.replace(regex, function(matched) {
- var a = '<a href="' + OC.generateUrl('/apps/social/timeline/tags/' + matched.substring(1)) + '">' + matched + '</a>'
- return a
- })
+ message = this.mangleHashtags(message)
message = this.$twemoji.parse(message)
return message
},
@@ -143,6 +138,15 @@ export default {
}
},
methods: {
+ mangleHashtags(msg) {
+ // Replace hashtag's href parameter with local ones
+ const regex = hashtagRegex()
+ msg = msg.replace(regex, function(matched) {
+ var a = '<a href="' + OC.generateUrl('/apps/social/timeline/tags/' + matched.substring(1)) + '">' + matched + '</a>'
+ return a
+ })
+ return msg;
+ },
userDisplayName(actorInfo) {
return actorInfo.name !== '' ? actorInfo.name : actorInfo.preferredUsername
},