diff options
Diffstat (limited to 'app/assets/javascripts/badges')
-rw-r--r-- | app/assets/javascripts/badges/components/badge_form.vue | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/badges/components/badge_form.vue b/app/assets/javascripts/badges/components/badge_form.vue index 7e605099655..2c7e878f044 100644 --- a/app/assets/javascripts/badges/components/badge_form.vue +++ b/app/assets/javascripts/badges/components/badge_form.vue @@ -1,6 +1,5 @@ <script> -/* eslint-disable vue/no-v-html */ -import { GlLoadingIcon, GlFormInput, GlFormGroup, GlButton } from '@gitlab/ui'; +import { GlLoadingIcon, GlFormInput, GlFormGroup, GlButton, GlSafeHtmlDirective } from '@gitlab/ui'; import { escape, debounce } from 'lodash'; import { mapActions, mapState } from 'vuex'; import createFlash from '~/flash'; @@ -19,6 +18,9 @@ export default { GlFormInput, GlFormGroup, }, + directives: { + SafeHtml: GlSafeHtmlDirective, + }, props: { isEditing: { type: Boolean, @@ -168,6 +170,7 @@ export default { }); }, }, + safeHtmlConfig: { ALLOW_TAGS: ['a', 'code'] }, }; </script> @@ -184,7 +187,7 @@ export default { <div class="form-group"> <label for="badge-link-url" class="label-bold">{{ s__('Badges|Link') }}</label> - <p v-html="helpText"></p> + <p v-safe-html:[$options.safeHtmlConfig]="helpText"></p> <input id="badge-link-url" v-model="linkUrl" @@ -199,7 +202,7 @@ export default { <div class="form-group"> <label for="badge-image-url" class="label-bold">{{ s__('Badges|Badge image URL') }}</label> - <p v-html="helpText"></p> + <p v-safe-html:[$options.safeHtmlConfig]="helpText"></p> <input id="badge-image-url" v-model="imageUrl" |