Skip to content

Commit

Permalink
Merge pull request #2791 from fm-sys/md_link_target
Browse files Browse the repository at this point in the history
Open description links in new tab
  • Loading branch information
juliusknorr authored Sep 9, 2021
2 parents 136a5ab + 6335f50 commit c011c53
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"lodash": "^4.17.21",
"markdown-it": "^12.2.0",
"markdown-it-task-lists": "^2.1.1",
"markdown-it-link-attributes": "^3.0.0",
"moment": "^2.29.1",
"nextcloud-vue-collections": "^0.9.0",
"p-queue": "^6.6.2",
Expand Down
8 changes: 8 additions & 0 deletions src/components/card/Description.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<script>
import MarkdownIt from 'markdown-it'
import MarkdownItTaskLists from 'markdown-it-task-lists'
import MarkdownItLinkAttributes from 'markdown-it-link-attributes'
import AttachmentList from './AttachmentList'
import { Actions, ActionButton, Modal } from '@nextcloud/vue'
import { formatFileSize } from '@nextcloud/files'
Expand All @@ -86,6 +87,13 @@ const markdownIt = new MarkdownIt({
})
markdownIt.use(MarkdownItTaskLists, { enabled: true, label: true, labelAfter: true })
markdownIt.use(MarkdownItLinkAttributes, {
attrs: {
target: '_blank',
rel: 'noreferrer noopener',
},
})
export default {
name: 'Description',
components: {
Expand Down

0 comments on commit c011c53

Please sign in to comment.