Skip to content

Commit

Permalink
🔧 removed additional wiki-unsafe brackets & replaced them w/ round ones
Browse files Browse the repository at this point in the history
  • Loading branch information
gy-mate committed Aug 23, 2024
1 parent 89b5f6b commit 475b903
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/moodle_to_vikwikiquiz/quiz/illustrations/illustration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
from .state_of_illustrations import StateOfIllustrations # type: ignore


def remove_wiki_unsafe_characters(upload_filename):
upload_filename = re.sub(r"[{\[]", "(", upload_filename)
upload_filename = re.sub(r"[}\]]", ")", upload_filename)
return upload_filename


class Illustration:
def __init__(
self,
Expand All @@ -14,7 +20,7 @@ def __init__(
original_file_path: Path | None = None,
) -> None:
assert isinstance(upload_filename, str)
upload_filename = re.sub(r"[{}]", "", upload_filename)
upload_filename = remove_wiki_unsafe_characters(upload_filename)
self.upload_filename = upload_filename

assert isinstance(size_in_pixels, int)
Expand Down

0 comments on commit 475b903

Please sign in to comment.