handle forward/backward slash in wildcards

pull/3136/head
Vladimir Mandic 2024-05-14 23:30:20 -04:00
parent af09f65f6d
commit 69d7fef190
1 changed files with 1 additions and 0 deletions

View File

@ -63,6 +63,7 @@ def apply_file_wildcards(prompt, replaced = [], not_found = [], recursion=0):
return prompt, replaced, not_found
matches = re.findall(r'__(.*?)__', prompt, re.DOTALL)
matches = [m for m in matches if m not in not_found]
matches = [m.replace('\\', os.path.sep) for m in matches if m not in replaced]
matches = [m.replace('/', os.path.sep) for m in matches if m not in replaced]
if len(matches) == 0:
return prompt, replaced, not_found