mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 11:25:58 +08:00
refactor(web): replace String.match() with RegExp.exec() for non-global regex (#32386)
This commit is contained in:
@@ -70,7 +70,7 @@ const BlockInput: FC<IBlockInputProps> = ({
|
||||
const renderSafeContent = (value: string) => {
|
||||
const parts = value.split(/(\{\{[^}]+\}\}|\n)/g)
|
||||
return parts.map((part, index) => {
|
||||
const variableMatch = part.match(/^\{\{([^}]+)\}\}$/)
|
||||
const variableMatch = /^\{\{([^}]+)\}\}$/.exec(part)
|
||||
if (variableMatch) {
|
||||
return (
|
||||
<VarHighlight
|
||||
|
||||
Reference in New Issue
Block a user