diff options
author | René Gieling <github@dartcafe.de> | 2020-09-04 18:19:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 18:19:41 +0300 |
commit | 5a47411767d2ca8db994404bba362fc8a165ec7c (patch) | |
tree | 928ad567af7be508eea75480c639418aa745c9bc | |
parent | 2fa58f4e94777d2113fe673b97f4bd73eb435897 (diff) | |
parent | 85793d7bef21ca9e16d5224a46d50bd4ebccfd3c (diff) |
Merge pull request #1078 from nextcloud/description-linkify
use linkifyjs for description
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/js/views/Vote.vue | 26 |
2 files changed, 17 insertions, 10 deletions
diff --git a/package.json b/package.json index b8181d8d..d9b3e9bd 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@nextcloud/router": "^1.2.0", "@nextcloud/vue": "^2.6.1", "core-js": "^3.6.5", + "linkifyjs": "^2.1.9", "lodash": "^4.17.20", "moment": "^2.27.0", "v-click-outside": "^3.1.0", diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue index 980ece4d..f8816f93 100644 --- a/src/js/views/Vote.vue +++ b/src/js/views/Vote.vue @@ -57,8 +57,9 @@ </h2> <PollInformation /> - <h3 class="description"> - {{ poll.description ? poll.description : t('polls', 'No description provided') }} + <!-- eslint-disable-next-line vue/no-v-html --> + <h3 class="description" v-html="linkifyDescription"> + {{ poll.description ? linkifyDescription : t('polls', 'No description provided') }} </h3> </div> @@ -90,19 +91,20 @@ </template> <script> +import linkifyStr from 'linkifyjs/string' +import { mapState, mapGetters } from 'vuex' import { Actions, ActionButton, AppContent } from '@nextcloud/vue' -import Subscription from '../components/Subscription/Subscription' +import { getCurrentUser } from '@nextcloud/auth' +import { emit } from '@nextcloud/event-bus' +import moment from '@nextcloud/moment' import Badge from '../components/Base/Badge' +import LoadingOverlay from '../components/Base/LoadingOverlay' import ParticipantsList from '../components/Base/ParticipantsList' import PersonalLink from '../components/Base/PersonalLink' import PollInformation from '../components/Base/PollInformation' -import LoadingOverlay from '../components/Base/LoadingOverlay' import PublicRegisterModal from '../components/Base/PublicRegisterModal' +import Subscription from '../components/Subscription/Subscription' import VoteTable from '../components/VoteTable/VoteTable' -import { mapState, mapGetters } from 'vuex' -import { getCurrentUser } from '@nextcloud/auth' -import { emit } from '@nextcloud/event-bus' -import moment from '@nextcloud/moment' export default { name: 'Vote', @@ -142,7 +144,11 @@ export default { isExpired: 'poll/expired', }), - windowTitle: function() { + linkifyDescription() { + return linkifyStr(this.poll.description) + }, + + windowTitle() { return t('polls', 'Polls') + ' - ' + this.poll.title }, @@ -188,7 +194,7 @@ export default { } }, - toggleViewIcon: function() { + toggleViewIcon() { if (this.tableMode) { return 'icon-phone' } else { |