mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Merge f2203ce8e7
into d2dd1796a8
This commit is contained in:
commit
06ea2b7a57
|
@ -74,7 +74,7 @@ const addTargetBlank = (html: string) =>
|
|||
:class="[$style.infoIcon, showTooltip ? $style.visible : $style.hidden]"
|
||||
>
|
||||
<N8nTooltip placement="top" :popper-class="$style.tooltipPopper" :show-after="300">
|
||||
<N8nIcon icon="question-circle" size="small" />
|
||||
<N8nIcon :class="$style.icon" icon="question-circle" size="small" />
|
||||
<template #content>
|
||||
<div v-n8n-html="addTargetBlank(tooltipText)" />
|
||||
</template>
|
||||
|
@ -143,6 +143,10 @@ const addTargetBlank = (html: string) =>
|
|||
}
|
||||
}
|
||||
|
||||
.infoIcon:has(.icon[aria-describedby]) {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.trailing-content {
|
||||
display: flex;
|
||||
gap: var(--spacing-3xs);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import sanitize from 'sanitize-html';
|
||||
import type { DirectiveBinding, ObjectDirective } from 'vue';
|
||||
import type { DirectiveBinding, FunctionDirective } from 'vue';
|
||||
|
||||
/**
|
||||
* Custom directive `n8nHtml` to replace v-html from Vue to sanitize content.
|
||||
|
@ -28,11 +28,11 @@ const configuredSanitize = (html: string) =>
|
|||
},
|
||||
});
|
||||
|
||||
export const n8nHtml: ObjectDirective = {
|
||||
beforeMount(el: HTMLElement, binding: DirectiveBinding<string>) {
|
||||
export const n8nHtml: FunctionDirective<HTMLElement, string> = (
|
||||
el: HTMLElement,
|
||||
binding: DirectiveBinding<string>,
|
||||
) => {
|
||||
if (binding.value !== binding.oldValue) {
|
||||
el.innerHTML = configuredSanitize(binding.value);
|
||||
},
|
||||
beforeUpdate(el: HTMLElement, binding: DirectiveBinding<string>) {
|
||||
el.innerHTML = configuredSanitize(binding.value);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue