Fix: string merge bug about agent TextProcessing. (\m) (#10211)

### What problem does this PR solve?
An error occurred while merging strings containing '\m' in the Text
Processing function of the agent.

Convert \ m to m using regular expressions

From my example alone, it doesn't affect the original meaning, it's
still math

<img width="1227" height="1056" alt="image"
src="https://github.com/user-attachments/assets/9306a8ca-bb97-47bf-b91f-77acfce49875"
/>


### Type of change

- [ √ ] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: mxc <mxc@example.com>
This commit is contained in:
zhimeng123
2025-09-23 10:16:11 +08:00
committed by GitHub
parent da82566304
commit 46a61e5aff

View File

@ -90,6 +90,8 @@ class StringTransform(Message, ABC):
for k,v in kwargs.items():
if not v:
v = ""
k = re.sub(r'\\m', 'm', k)
v = re.sub(r'\\m', 'm', v)
script = re.sub(k, v, script)
self.set_output("result", script)