Add pattern for variable tag in tiptap (#16652)

Since we now store rich text value in blocknote rather than markdown,
variables need to be resolved accordingly.

Replacing the variable tag pattern
`{"type":"variableTag","attrs":\{"variable":"(\{\{[^{}]+\}\})"\}\}` by a
blocknote text `{"type":"text","text":"${escapedText}"}`

Fixes https://github.com/twentyhq/twenty/issues/16583

To test :
- build a workflow that creates a note/ sends an email with a variable
in the body
- make sure the result is properly formatted once run

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
Thomas Trompette
2025-12-18 17:24:13 +01:00
committed by GitHub
parent 636cec0f59
commit b2d2babbb9
11 changed files with 429 additions and 55 deletions
@@ -268,7 +268,7 @@ export const WorkflowEditActionUpsertRecord = ({
<FormSingleRecordPicker
key="id"
testId="workflow-upsert-record-id"
label={t`Record (ID)`}
label="Record (ID)"
onChange={(recordId) => {
handleFieldChange('id', recordId);
}}