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:
authorRené Gieling <github@dartcafe.de>2022-06-27 21:18:53 +0300
committerGitHub <noreply@github.com>2022-06-27 21:18:53 +0300
commit3d807b287a15180bf4669c574025dbf39ef09ad7 (patch)
tree20b186c8d6ce56d0208df3f0ac1b69ed5041a2fa /src
parenta58e4376a0568711d4b6d94f8cb025b873289bde (diff)
parent73a38f097b5a565a656a8073e942e059ea08e7e8 (diff)
Merge pull request #2476 from nextcloud/enh/linkify-comments
Linkify comments
Diffstat (limited to 'src')
-rw-r--r--src/js/components/Comments/CommentItem.vue17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/js/components/Comments/CommentItem.vue b/src/js/components/Comments/CommentItem.vue
index 7ef6c66f..29954702 100644
--- a/src/js/components/Comments/CommentItem.vue
+++ b/src/js/components/Comments/CommentItem.vue
@@ -29,9 +29,11 @@
<div v-for="(subComment) in comment.subComments"
:key="subComment.id"
class="comment-item__subcomment">
- <span class="comment-item__comment">
- {{ subComment.comment }}
- </span>
+ <!-- eslint-disable vue/no-v-html -->
+ <span class="comment-item__comment"
+ v-html="linkify(subComment.comment)" />
+ <!-- eslint-enable vue/no-v-html -->
+
<ActionDelete v-if="comment.user.userId === acl.userId || acl.isOwner"
:title="t('polls', 'Delete comment')"
@delete="deleteComment(subComment)" />
@@ -42,6 +44,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 +72,10 @@ export default {
},
methods: {
+ linkify(comment) {
+ return linkifyStr(comment)
+ },
+
async deleteComment(comment) {
try {
await this.$store.dispatch({ type: 'comments/delete', comment })
@@ -123,10 +130,12 @@ export default {
}
}
}
-
.comment-item__comment {
hyphens: auto;
flex: 1;
+ a {
+ text-decoration-line: underline;
+ }
}
}