Skip to content

Commit

Permalink
Fixing regex to accommodate extra whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcginty authored Mar 21, 2024
1 parent 4e2becf commit 94a096b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simpinkscr/simple_inkscape_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3724,8 +3724,8 @@ def effect(self):

# Remove an unnecessary import that may be introduced when
# running from Visual Studio Code.
pattern = r"^(import (inkex|simpinkscr)|(from (inkex|simpinkscr) import.*))\r*\n*"
code = re.sub(pattern, "", code, flags=re.MULTILINE+re.IGNORECASE)
pattern = r"^[ \t]*(import\s+(inkex|simpinkscr).*|(from\s+(inkex|simpinkscr)\s+import).*)[\r\n]?"
code = re.sub(pattern, "", code, flags=re.MULTILINE)

# Launch the user's script.
try:
Expand Down

0 comments on commit 94a096b

Please sign in to comment.