Migrate to vue3 (fix #126) #127
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,5 +9,6 @@
|
|||||||
|
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/js/
|
/js/
|
||||||
|
/css/
|
||||||
|
|
||||||
/build/
|
/build/
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css",
|
"stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css",
|
||||||
"stylelint:fix": "stylelint src/**/*.vue src/**/*.scss src/**/*.css --fix"
|
"stylelint:fix": "stylelint src/**/*.vue src/**/*.scss src/**/*.css --fix"
|
||||||
},
|
},
|
||||||
|
"type": "module",
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"extends @nextcloud/browserslist-config"
|
"extends @nextcloud/browserslist-config"
|
||||||
],
|
],
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import dompurify from 'dompurify'
|
||||||
import linkifyHtml from 'linkify-html'
|
import linkifyHtml from 'linkify-html'
|
||||||
import { sanitize } from 'dompurify'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SafeHtml',
|
name: 'SafeHtml',
|
||||||
directives: {
|
directives: {
|
||||||
sanitize: {
|
sanitize: {
|
||||||
inserted(el, binding) {
|
inserted(el, binding) {
|
||||||
el.innerHTML = sanitize(
|
el.innerHTML = dompurify.sanitize(
|
||||||
linkifyHtml(binding.value, {
|
linkifyHtml(binding.value, {
|
||||||
nl2br: true,
|
nl2br: true,
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
|
Loading…
Reference in New Issue
Block a user