Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2022-06-27 21:12:35 +0300
committerdartcafe <github@dartcafe.de>2022-06-27 21:12:35 +0300
commite892f1609360985a724ca46306e5d34db1b245ff (patch)
tree37742f6d4231ecec02f6517a9b04fccbca2a5feb /src
parent98063083ca2711599dd4b8d3b3ac90856968014f (diff)
linkify comments
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src')
-rw-r--r--src/js/components/Comments/CommentItem.vue12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/js/components/Comments/CommentItem.vue b/src/js/components/Comments/CommentItem.vue
index 7ef6c66f..cdc8a1e9 100644
--- a/src/js/components/Comments/CommentItem.vue
+++ b/src/js/components/Comments/CommentItem.vue
@@ -29,7 +29,8 @@
<div v-for="(subComment) in comment.subComments"
:key="subComment.id"
class="comment-item__subcomment">
- <span class="comment-item__comment">
+ <span class="comment-item__comment"
+ v-html="linkify(subComment.comment)">
{{ subComment.comment }}
</span>
<ActionDelete v-if="comment.user.userId === acl.userId || acl.isOwner"
@@ -42,6 +43,7 @@
<script>
import moment from '@nextcloud/moment'
+import linkifyStr from 'linkify-string'
import { showError } from '@nextcloud/dialogs'
import { mapState } from 'vuex'
import ActionDelete from '../Actions/ActionDelete.vue'
@@ -69,6 +71,10 @@ export default {
},
methods: {
+ linkify(comment) {
+ return linkifyStr(comment)
+ },
+
async deleteComment(comment) {
try {
await this.$store.dispatch({ type: 'comments/delete', comment })
@@ -123,10 +129,12 @@ export default {
}
}
}
-
.comment-item__comment {
hyphens: auto;
flex: 1;
+ a {
+ text-decoration-line: underline;
+ }
}
}