Bugfix/Remove Markdown in Condition (#4761)

Feature/Add remove-markdown dependency and integrate into Condition node for text processing

- Added `remove-markdown` package to `packages/components/package.json`.
- Integrated `removeMarkdown` function in `Condition.ts` to sanitize string inputs by removing markdown formatting.
This commit is contained in:
Henry Heng
2025-06-30 12:06:23 +01:00
committed by GitHub
parent be7599542b
commit 9b60cf1234
3 changed files with 12 additions and 2 deletions
@@ -1,4 +1,5 @@
import { CommonType, ICommonObject, ICondition, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
import removeMarkdown from 'remove-markdown'
class Condition_Agentflow implements INode {
label: string
@@ -300,8 +301,8 @@ class Condition_Agentflow implements INode {
value2 = parseFloat(_value2 as string) || 0
break
default: // string
value1 = _value1 as string
value2 = _value2 as string
value1 = removeMarkdown((_value1 as string) || '')
value2 = removeMarkdown((_value2 as string) || '')
}
const compareOperationResult = compareOperationFunctions[operation](value1, value2)