Merge pull request #173 from davejcameron/dc-fix-chat-to-files-bracket

Fix square bracket file name issue
This commit is contained in:
Anton Osika
2023-06-19 15:49:21 +02:00
committed by GitHub
2 changed files with 97 additions and 0 deletions

View File

@@ -11,6 +11,9 @@ def parse_chat(chat): # -> List[Tuple[str, str]]:
# Strip the filename of any non-allowed characters and convert / to \
path = re.sub(r'[<>"|?*]', "", match.group(1))
# Remove leading and trailing brackets
path = re.sub(r"^\[(.*)\]$", r"\1", path)
# Get the code
code = match.group(2)