Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix replaceMessage function to handle escaped variables (#716)
* Fix replaceMessage function to handle escaped variables Modify the `replaceMessage` function in `src/utils/validateUtil.ts` to handle escaped variables and add related test cases. * **replaceMessage function**: - Update the `replaceMessage` function to skip conversion when `\${xxx}` is passed and convert `${xxx}` correctly. - Check for the presence of `\${xxx}` and skip conversion in such cases. - Ensure the function correctly converts `${xxx}` to the corresponding value from the `kv` object. * **validate.test.tsx**: - Add test cases to verify the correct handling of `\${xxx}` and `${xxx}`. - Ensure the test cases cover both scenarios: skipping conversion and converting correctly. - Add a new test case to handle escaped and unescaped variables correctly. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/react-component/field-form?shareId=XXXX-XXXX-XXXX-XXXX). * Update validateUtil.ts * test: fix test case
- Loading branch information