mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
feat(Form Node): Enable HTML in form description
This commit is contained in:
parent
ba14c91255
commit
18516968e8
|
@ -327,7 +327,7 @@
|
|||
<form class='card' action='#' method='POST' name='n8n-form' id='n8n-form' novalidate>
|
||||
<div class='form-header'>
|
||||
<h1>{{formTitle}}</h1>
|
||||
<p style="white-space: pre-line">{{formDescription}} </p>
|
||||
<p style="white-space: pre-line">{{{formDescription}}} </p>
|
||||
</div>
|
||||
|
||||
<div class='inputs-wrapper'>
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
WAIT_NODE_TYPE,
|
||||
jsonParse,
|
||||
} from 'n8n-workflow';
|
||||
import sanitize from 'sanitize-html';
|
||||
|
||||
import type { FormTriggerData, FormTriggerInput } from './interfaces';
|
||||
import { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from './interfaces';
|
||||
|
@ -373,7 +374,13 @@ export async function formWebhook(
|
|||
//Show the form on GET request
|
||||
if (method === 'GET') {
|
||||
const formTitle = context.getNodeParameter('formTitle', '') as string;
|
||||
const formDescription = context.getNodeParameter('formDescription', '') as string;
|
||||
const formDescription = sanitize(context.getNodeParameter('formDescription', '') as string, {
|
||||
allowedTags: ['b', 'i', 'em', 'strong', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
||||
allowedAttributes: {
|
||||
a: ['href'],
|
||||
},
|
||||
nonBooleanAttributes: ['*'],
|
||||
});
|
||||
const responseMode = context.getNodeParameter('responseMode', '') as string;
|
||||
|
||||
let formSubmittedText;
|
||||
|
|
Loading…
Reference in a new issue