Commit ab28a750 authored by jboyson's avatar jboyson

Fix images not rendering

This is due to improper initialization of `sanitize`
Basically we were restricting so that only elements with
a `src` attribute would render.

I also added a `pre` tag to dump out the raw data for code
that did not pass sanitization.
parent 9146b7b4
......@@ -20,12 +20,15 @@ export default {
type: Number,
required: true,
},
codeCssClass: {
type: String,
required: false,
default: '',
},
},
computed: {
sanitizedOutput() {
return sanitize(this.rawCode, {
ALLOWED_ATTR: ['src'],
});
return sanitize(this.rawCode);
},
showOutput() {
return this.index === 0;
......@@ -37,6 +40,7 @@ export default {
<template>
<div class="output">
<prompt type="Out" :count="count" :show-output="showOutput" />
<div class="gl-overflow-auto" v-html="sanitizedOutput"></div>
<div v-if="sanitizedOutput.length" class="gl-overflow-auto" v-html="sanitizedOutput"></div>
<pre v-else ref="code" :class="codeCssClass" class="language-python" v-text="rawCode"></pre>
</div>
</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