mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
feat: + notation
This commit is contained in:
parent
d79fe56a38
commit
b95a01079c
1 changed files with 2 additions and 2 deletions
|
|
@ -72,9 +72,9 @@ class Teacher(Role):
|
|||
@staticmethod
|
||||
def new_file_name(lesson_title, ext=".md"):
|
||||
"""Create a related file name based on `lesson_title` and `ext`."""
|
||||
# 定义需要替换的特殊字符
|
||||
# Define the special characters that need to be replaced.
|
||||
illegal_chars = r'[#@$%!*&\\/:*?"<>|\n\t \']'
|
||||
# 将特殊字符替换为下划线
|
||||
# Replace the special characters with underscores.
|
||||
filename = re.sub(illegal_chars, '_', lesson_title) + ext
|
||||
return re.sub(r'_+', '_', filename)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue