Commit 7b3cf5d6 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'imrishabh18-#241887' into 'master'

Remove v-html from repository preview

See merge request gitlab-org/gitlab!70833
parents 518d76c9 3bac7a21
<script> <script>
import { GlIcon, GlLink, GlLoadingIcon } from '@gitlab/ui'; import { GlIcon, GlLink, GlLoadingIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import $ from 'jquery'; import $ from 'jquery';
import '~/behaviors/markdown/render_gfm'; import '~/behaviors/markdown/render_gfm';
import { handleLocationHash } from '~/lib/utils/common_utils'; import { handleLocationHash } from '~/lib/utils/common_utils';
...@@ -22,6 +22,9 @@ export default { ...@@ -22,6 +22,9 @@ export default {
GlLink, GlLink,
GlLoadingIcon, GlLoadingIcon,
}, },
directives: {
SafeHtml,
},
props: { props: {
blob: { blob: {
type: Object, type: Object,
...@@ -59,11 +62,7 @@ export default { ...@@ -59,11 +62,7 @@ export default {
</div> </div>
<div class="blob-viewer" data-qa-selector="blob_viewer_content" itemprop="about"> <div class="blob-viewer" data-qa-selector="blob_viewer_content" itemprop="about">
<gl-loading-icon v-if="loading > 0" size="md" color="dark" class="my-4 mx-auto" /> <gl-loading-icon v-if="loading > 0" size="md" color="dark" class="my-4 mx-auto" />
<div <div v-else-if="readme" ref="readme" v-safe-html="readme.html"></div>
v-else-if="readme"
ref="readme"
v-html="readme.html /* eslint-disable-line vue/no-v-html */"
></div>
</div> </div>
</article> </article>
</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