This commit is contained in:
2020-04-16 15:50:27 +00:00
parent 4107060c51
commit 079453e0d8
3 changed files with 12 additions and 7 deletions

View File

@@ -9695,6 +9695,11 @@
"domelementtype": "1"
}
},
"dompurify": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.0.8.tgz",
"integrity": "sha512-vIOSyOXkMx81ghEalh4MLBtDHMx1bhKlaqHDMqM2yeitJ996SLOk5mGdDpI9ifJAgokred8Rmu219fX4OltqXw=="
},
"domutils": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",

View File

@@ -13,6 +13,7 @@
},
"dependencies": {
"core-js": "^3.6.4",
"dompurify": "^2.0.8",
"jwt-decode": "^2.2.0",
"luxon": "^1.22.2",
"marked": "^0.8.2",

View File

@@ -3,17 +3,13 @@
<span class="v-label v-label--active theme--light">
{{ $ay.t("WikiPage") }}
</span>
<v-sheet
elevation="1"
color="grey lighten-5"
v-html="compiledOutput()"
class="pa-2 pa-sm-6"
>
<v-sheet elevation="2" v-html="compiledOutput()" class="pa-2 pa-sm-6">
</v-sheet>
</div>
</template>
<script>
import marked from "marked";
import DOMPurify from "dompurify";
export default {
data: () => ({}),
props: {
@@ -22,7 +18,7 @@ export default {
methods: {
compiledOutput() {
//return marked(this.content, { sanitize: true });
return marked(this.value);
return DOMPurify.sanitize(marked(this.value));
}
}
};
@@ -35,5 +31,8 @@ remove extra spacing on sides in xs mode (gutters maybe on column or row?)
Show/hide/edit control
eyeball icon like password reveal
baseurl setting for local images:
https://marked.js.org/#/USING_ADVANCED.md#options
*/
</script>