@@ -7,7 +7,10 @@ import {
|
|||||||
} from '@typebot.io/schemas'
|
} from '@typebot.io/schemas'
|
||||||
import { deepParseVariables } from './variables/deepParseVariables'
|
import { deepParseVariables } from './variables/deepParseVariables'
|
||||||
import { isEmpty, isNotEmpty } from '@typebot.io/lib/utils'
|
import { isEmpty, isNotEmpty } from '@typebot.io/lib/utils'
|
||||||
import { getVariablesToParseInfoInText } from './variables/parseVariables'
|
import {
|
||||||
|
getVariablesToParseInfoInText,
|
||||||
|
parseVariables,
|
||||||
|
} from './variables/parseVariables'
|
||||||
import { TDescendant, createPlateEditor } from '@udecode/plate-common'
|
import { TDescendant, createPlateEditor } from '@udecode/plate-common'
|
||||||
import {
|
import {
|
||||||
createDeserializeMdPlugin,
|
createDeserializeMdPlugin,
|
||||||
@@ -155,12 +158,16 @@ const parseVariablesInRichText = (
|
|||||||
element.children.length === 1 &&
|
element.children.length === 1 &&
|
||||||
'text' in element.children[0] &&
|
'text' in element.children[0] &&
|
||||||
(element.children[0].text as string).startsWith('{{') &&
|
(element.children[0].text as string).startsWith('{{') &&
|
||||||
(element.children[0].text as string).endsWith('}}')
|
(element.children[0].text as string).endsWith('}}') &&
|
||||||
|
element.type !== 'a'
|
||||||
? 'variable'
|
? 'variable'
|
||||||
: element.type
|
: element.type
|
||||||
|
|
||||||
parsedElements.push({
|
parsedElements.push({
|
||||||
...element,
|
...element,
|
||||||
|
url: element.url
|
||||||
|
? parseVariables(variables)(element.url as string)
|
||||||
|
: undefined,
|
||||||
type,
|
type,
|
||||||
children: parseVariablesInRichText(element.children as TDescendant[], {
|
children: parseVariablesInRichText(element.children as TDescendant[], {
|
||||||
variables,
|
variables,
|
||||||
|
|||||||
Reference in New Issue
Block a user