fix(editor): Replace v-html with custom directive to sanitize html (#10804)

Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
Csaba Tuncsik
2024-09-18 08:49:41 +02:00
committed by GitHub
parent 989f69d1f4
commit 44e5fb9b06
49 changed files with 379 additions and 130 deletions

View File

@@ -163,7 +163,7 @@ function onCommunityNodeTooltipClick(event: MouseEvent) {
<p
:class="$style.communityNodeIcon"
@click="onCommunityNodeTooltipClick"
v-html="
v-n8n-html="
i18n.baseText('generic.communityNode.tooltip', {
interpolate: {
packageName: nodeType.name.split('.')[0],

View File

@@ -258,7 +258,7 @@ onMounted(() => {
data-test-id="actions-panel-no-triggers-callout"
>
<span
v-html="
v-n8n-html="
i18n.baseText('nodeCreator.actionsCallout.noTriggerItems', {
interpolate: { nodeName: subcategory ?? '' },
})
@@ -271,7 +271,7 @@ onMounted(() => {
<p
:class="$style.resetSearch"
@click="resetSearch"
v-html="i18n.baseText('nodeCreator.actionsCategory.noMatchingTriggers')"
v-n8n-html="i18n.baseText('nodeCreator.actionsCategory.noMatchingTriggers')"
/>
</template>
</CategorizedItemsRenderer>
@@ -293,13 +293,13 @@ onMounted(() => {
slim
data-test-id="actions-panel-activation-callout"
>
<span v-html="i18n.baseText('nodeCreator.actionsCallout.triggersStartWorkflow')" />
<span v-n8n-html="i18n.baseText('nodeCreator.actionsCallout.triggersStartWorkflow')" />
</n8n-callout>
<!-- Empty state -->
<template #empty>
<n8n-info-tip v-if="!search" theme="info" type="note" :class="$style.actionsEmpty">
<span
v-html="
v-n8n-html="
i18n.baseText('nodeCreator.actionsCallout.noActionItems', {
interpolate: { nodeName: subcategory ?? '' },
})
@@ -311,7 +311,7 @@ onMounted(() => {
:class="$style.resetSearch"
data-test-id="actions-panel-no-matching-actions"
@click="resetSearch"
v-html="i18n.baseText('nodeCreator.actionsCategory.noMatchingActions')"
v-n8n-html="i18n.baseText('nodeCreator.actionsCategory.noMatchingActions')"
/>
</template>
</CategorizedItemsRenderer>
@@ -320,7 +320,7 @@ onMounted(() => {
<div v-if="containsAPIAction" :class="$style.apiHint">
<span
@click.prevent="addHttpNode"
v-html="
v-n8n-html="
i18n.baseText('nodeCreator.actionsList.apiCall', {
interpolate: { node: subcategory ?? '' },
})

View File

@@ -106,7 +106,7 @@ registerKeyHook(`CategoryLeft_${props.category}`, {
<n8n-tooltip placement="top" :popper-class="$style.tooltipPopper">
<n8n-icon icon="question-circle" size="small" />
<template #content>
<div v-html="mouseOverTooltip" />
<div v-n8n-html="mouseOverTooltip" />
</template>
</n8n-tooltip>
</span>