🐛 (textBubble) Fix link parsing in text editor
This commit is contained in:
@ -3,6 +3,7 @@ import { useTypebot } from '@/features/editor'
|
||||
import { TextBubbleBlock } from 'models'
|
||||
import React from 'react'
|
||||
import { parseVariableHighlight } from '@/utils/helpers'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type Props = {
|
||||
block: TextBubbleBlock
|
||||
@ -17,11 +18,11 @@ export const TextBubbleContent = ({ block }: Props) => {
|
||||
flexDir={'column'}
|
||||
opacity={block.content.html === '' ? '0.5' : '1'}
|
||||
className="slate-html-container"
|
||||
color={isEmpty(block.content.plainText) ? 'gray.500' : 'inherit'}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html:
|
||||
block.content.html === ''
|
||||
? `<p>Click to edit...</p>`
|
||||
: parseVariableHighlight(block.content.html, typebot),
|
||||
__html: isEmpty(block.content.plainText)
|
||||
? `<p>Click to edit...</p>`
|
||||
: parseVariableHighlight(block.content.html, typebot),
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
@ -23,10 +23,11 @@ export const platePlugins = createPlugins(
|
||||
renderAfterEditable: PlateFloatingLink,
|
||||
options: {
|
||||
isUrl: (url: string) =>
|
||||
url.startsWith('http') ||
|
||||
url.startsWith('mailto') ||
|
||||
url.startsWith('tel') ||
|
||||
url.startsWith('sms'),
|
||||
url.startsWith('http:') ||
|
||||
url.startsWith('https:') ||
|
||||
url.startsWith('mailto:') ||
|
||||
url.startsWith('tel:') ||
|
||||
url.startsWith('sms:'),
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
Reference in New Issue
Block a user