diff --git a/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx b/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx index 94e5aadc7e..f428b4b063 100644 --- a/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx +++ b/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx @@ -1,6 +1,7 @@ import { useState, useRef, useEffect, useCallback, useMemo } from 'react' import { cn } from '@/lib/utils' import { useSubBlockValue } from '../hooks/use-sub-block-value' +import { formatDisplayText } from '@/components/ui/formatted-text' interface CodeLine { id: string @@ -714,6 +715,9 @@ export function Code({ blockId, subBlockId, isConnecting }: CodeProps) { wrap="off" onPaste={handlePaste} /> +
+ {formatDisplayText(line.content)} +
))} diff --git a/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx b/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx index ac925d314e..f8d191f9e0 100644 --- a/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx +++ b/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx @@ -3,6 +3,7 @@ import { useSubBlockValue } from '../hooks/use-sub-block-value' import { cn } from '@/lib/utils' import { useState, useRef, useEffect } from 'react' import { SubBlockConfig } from '@/blocks/types' +import { formatDisplayText } from '@/components/ui/formatted-text' interface LongInputProps { placeholder?: string @@ -63,25 +64,6 @@ export function LongInput({ e.preventDefault() } - const formatDisplayText = (text: string) => { - if (!text) return null - - // Split the text by tag pattern - const parts = text.split(/(<[^>]+>)/g) - - return parts.map((part, index) => { - // Check if the part matches tag pattern - if (part.match(/^<[^>]+>$/)) { - return ( - - {part} - - ) - } - return {part} - }) - } - return (