mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-30 14:52:36 +00:00
fix: use dynamic separator in slugify for dedup and strip
This commit is contained in:
@@ -67,8 +67,9 @@ def slugify(text: str, separator: str = "_") -> str:
|
||||
text = text.lower()
|
||||
text = _QUOTE_PATTERN.sub("", text)
|
||||
text = _DISALLOWED_CHARS_PATTERN.sub(separator, text)
|
||||
text = _DUPLICATE_SEPARATOR_PATTERN.sub(separator, text)
|
||||
return text.strip("-_")
|
||||
escaped_sep = re.escape(separator)
|
||||
text = re.sub(f"(?:{escaped_sep}){{2,}}", separator, text)
|
||||
return text.strip(separator)
|
||||
|
||||
|
||||
def interpolate_only(
|
||||
|
||||
Reference in New Issue
Block a user