Commit 199b9314 authored by Phil Hughes's avatar Phil Hughes

Merge branch '241936-replace-v-html' into 'master'

Removes v-html from app/assets/javascripts/vue_shared/components/content_viewer/viewers/markdown_viewer.vue

See merge request gitlab-org/gitlab!73083
parents b9322139 af2f9ccf
<script> <script>
import { GlDeprecatedSkeletonLoading as GlSkeletonLoading } from '@gitlab/ui'; import {
GlDeprecatedSkeletonLoading as GlSkeletonLoading,
GlSafeHtmlDirective as SafeHtml,
} from '@gitlab/ui';
import $ from 'jquery'; import $ from 'jquery';
import '~/behaviors/markdown/render_gfm'; import '~/behaviors/markdown/render_gfm';
import { forEach, escape } from 'lodash'; import { forEach, escape } from 'lodash';
...@@ -13,6 +16,9 @@ export default { ...@@ -13,6 +16,9 @@ export default {
components: { components: {
GlSkeletonLoading, GlSkeletonLoading,
}, },
directives: {
SafeHtml,
},
props: { props: {
content: { content: {
type: String, type: String,
...@@ -103,6 +109,7 @@ export default { ...@@ -103,6 +109,7 @@ export default {
} }
}, },
}, },
safeHtmlConfig: { ADD_TAGS: ['gl-emoji', 'use'] },
}; };
</script> </script>
...@@ -111,8 +118,8 @@ export default { ...@@ -111,8 +118,8 @@ export default {
<gl-skeleton-loading v-if="isLoading" /> <gl-skeleton-loading v-if="isLoading" />
<div <div
v-else v-else
v-safe-html:[$options.safeHtmlConfig]="previewContent"
class="md gl-ml-auto gl-mr-auto" class="md gl-ml-auto gl-mr-auto"
v-html="previewContent /* eslint-disable-line vue/no-v-html */"
></div> ></div>
</div> </div>
</template> </template>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment