Handle newlines between filename (#250)

This commit is contained in:
David Cameron
2023-06-20 12:43:12 -04:00
committed by GitHub
parent 1bb04a1c4f
commit 0d0aaaa9b0
2 changed files with 55 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ import re
def parse_chat(chat): # -> List[Tuple[str, str]]:
# Get all ``` blocks and preceding filenames
regex = r"(\S+?)\n```\S+\n(.+?)```"
regex = r"(\S+)\n\s*```[^\n]*\n(.+?)```"
matches = re.finditer(regex, chat, re.DOTALL)
files = []