aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/components/AppDetails.vue
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-01 12:07:48 +0200
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-09-03 19:16:13 +0000
commit7a1748e6f02988891c6e70e50aa9e4d791fa0211 (patch)
tree1ae702c782c7f8ce703adce76228969003c900da /apps/settings/src/components/AppDetails.vue
parent5826b75c4025529805135595da46d63c7d46560f (diff)
downloadnextcloud-server-7a1748e6f02988891c6e70e50aa9e4d791fa0211.tar.gz
nextcloud-server-7a1748e6f02988891c6e70e50aa9e4d791fa0211.zip
Show changelog in apps management
Signed-off-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/settings/src/components/AppDetails.vue')
-rw-r--r--apps/settings/src/components/AppDetails.vue67
1 files changed, 3 insertions, 64 deletions
diff --git a/apps/settings/src/components/AppDetails.vue b/apps/settings/src/components/AppDetails.vue
index 55519bf9f80..d79f799fbb9 100644
--- a/apps/settings/src/components/AppDetails.vue
+++ b/apps/settings/src/components/AppDetails.vue
@@ -139,24 +139,23 @@
target="_blank"
rel="noreferrer noopener">{{ t('settings', 'Developer documentation') }} ↗</a>
</p>
-
- <div class="app-details__description" v-html="renderMarkdown" />
+ <Markdown class="app-details__description" :text="app.description" />
</div>
</template>
<script>
import { Multiselect } from '@nextcloud/vue'
-import marked from 'marked'
-import dompurify from 'dompurify'
import AppManagement from '../mixins/AppManagement'
import PrefixMixin from './PrefixMixin'
+import Markdown from './Markdown'
export default {
name: 'AppDetails',
components: {
Multiselect,
+ Markdown,
},
mixins: [AppManagement, PrefixMixin],
@@ -204,66 +203,6 @@ export default {
.filter(group => group.id !== 'disabled')
.sort((a, b) => a.name.localeCompare(b.name))
},
- renderMarkdown() {
- const renderer = new marked.Renderer()
- renderer.link = function(href, title, text) {
- let prot
- try {
- prot = decodeURIComponent(unescape(href))
- .replace(/[^\w:]/g, '')
- .toLowerCase()
- } catch (e) {
- return ''
- }
-
- if (prot.indexOf('http:') !== 0 && prot.indexOf('https:') !== 0) {
- return ''
- }
-
- let out = '<a href="' + href + '" rel="noreferrer noopener"'
- if (title) {
- out += ' title="' + title + '"'
- }
- out += '>' + text + '</a>'
- return out
- }
- renderer.image = function(href, title, text) {
- if (text) {
- return text
- }
- return title
- }
- renderer.blockquote = function(quote) {
- return quote
- }
- return dompurify.sanitize(
- marked(this.app.description.trim(), {
- renderer,
- gfm: false,
- highlight: false,
- tables: false,
- breaks: false,
- pedantic: false,
- sanitize: true,
- smartLists: true,
- smartypants: false,
- }),
- {
- SAFE_FOR_JQUERY: true,
- ALLOWED_TAGS: [
- 'strong',
- 'p',
- 'a',
- 'ul',
- 'ol',
- 'li',
- 'em',
- 'del',
- 'blockquote',
- ],
- }
- )
- },
},
mounted() {
if (this.app.groups.length > 0) {