mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
refactor(editor): Move editor-ui and design-system to frontend dir (no-changelog) (#13564)
This commit is contained in:
43
packages/frontend/editor-ui/src/components/RunDataHtml.vue
Normal file
43
packages/frontend/editor-ui/src/components/RunDataHtml.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<script lang="ts">
|
||||
import sanitizeHtml, { defaults, type IOptions as SanitizeOptions } from 'sanitize-html';
|
||||
|
||||
const sanitizeOptions: SanitizeOptions = {
|
||||
allowVulnerableTags: false,
|
||||
enforceHtmlBoundary: false,
|
||||
disallowedTagsMode: 'discard',
|
||||
allowedTags: [...defaults.allowedTags, 'style', 'img', 'title'],
|
||||
allowedAttributes: {
|
||||
...defaults.allowedAttributes,
|
||||
'*': ['class', 'style'],
|
||||
},
|
||||
transformTags: {
|
||||
head: '',
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'RunDataHtml',
|
||||
props: {
|
||||
inputHtml: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
sanitizedHtml() {
|
||||
return sanitizeHtml(this.inputHtml, sanitizeOptions);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<iframe class="__html-display" :srcdoc="sanitizedHtml" />
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.__html-display {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user