Add component 'Template' (#3562)

### What problem does this PR solve?

#3560

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-11-21 18:26:22 +08:00
committed by GitHub
parent 193b08a3ed
commit ee50f78d99
6 changed files with 9 additions and 8 deletions

View File

@ -79,7 +79,7 @@ class Template(ComponentBase):
self._param.inputs.append({"component_id": para["component_id"], "content": kwargs[para["key"]]})
for n, v in kwargs.items():
content = re.sub(r"\{%s\}" % re.escape(n), re.escape(str(v)), content)
content = re.sub(r"\{%s\}" % re.escape(n), str(v), content)
return Template.be_output(content)