Skip to content

Commit 36f8e3c

Browse files
committed
filename generation now handles special characters correctly
1 parent 98c92e4 commit 36f8e3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

in2lambda/json_convert/json_convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import json
44
import os
5+
import re
56
import shutil
67
import zipfile
78
from copy import deepcopy
@@ -97,7 +98,7 @@ def converter(
9798

9899
# Output file
99100
filename = (
100-
"question_" + str(i).zfill(3) + "_" + output["title"].replace(" ", "_")
101+
"question_" + str(i).zfill(3) + "_" + re.sub(r'[^\w\-_.]', '_', output['title'].strip())
101102
)
102103

103104
# write questions into directory

0 commit comments

Comments
 (0)