Skip to content

The open alternative to Salesforce, designed for AI.

Fix line break in richTextV2 field workflow editor (#16462)

Etienne5e44781be1b9
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormRichTextV2FieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormRichTextV2FieldInput.stories.tsx
index 65a0e701aff..1dce5e37ffd 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormRichTextV2FieldInput.stories.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormRichTextV2FieldInput.stories.tsx
@@ -90,7 +90,7 @@ export const WithVariable: Story = {
await waitFor(() => {
expect(args.onChange).toHaveBeenCalledWith({
blocknote: null,
- markdown: `## Title\nVariable: {{${MOCKED_STEP_ID}.name}}`,
+ markdown: `## Title \nVariable: {{${MOCKED_STEP_ID}.name}}`,
});
});
expect(args.onChange).toHaveBeenCalledTimes(1);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/parseEditorContent.test.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/parseEditorContent.test.ts
index c5f4f07516f..eb91b4b0f3f 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/parseEditorContent.test.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/parseEditorContent.test.ts
@@ -265,7 +265,7 @@ describe('parseEditorContent', () => {
],
};
- expect(parseEditorContent(input)).toBe('First line\nSecond line');
+ expect(parseEditorContent(input)).toBe('First line \nSecond line');
});
it('should handle spaces between variables correctly', () => {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/utils/parseEditorContent.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/parseEditorContent.ts
index 7c28a407916..05884fa397e 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/utils/parseEditorContent.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/parseEditorContent.ts
@@ -16,7 +16,7 @@ export const parseEditorContent = (json: JSONContent): string => {
}
if (node.type === 'hardBreak') {
- return '\n';
+ return ' \n';
}
if (node.type === 'variableTag') {