Skip to content

Commit

Permalink
Merge pull request #9 from olcf/hotfix/1
Browse files Browse the repository at this point in the history
Fixed Conditionals and '\'
  • Loading branch information
AcerP-py authored Sep 19, 2024
2 parents 7a7e07b + 7b00d32 commit 3e9448c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/velocity/_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _filter_content(cls, image: Image, text: str) -> str:
res: re_Match[str] = re_match(r".*(\?\?([\S ]*)\|>(.*)\?\?).*", text)
if res is not None:
if image.satisfies(res.group(2)):
text = re_sub(r".*(\?\?.*\?\?).*", res.group(3), text)
text = re_sub(r"(\?\?.*\?\?)", res.group(3).strip(), text)
else:
text = ""

Expand Down Expand Up @@ -290,7 +290,7 @@ def _run(self, contents: list[str], label_contents: list[str]) -> list[str]:
ln += " "
ln += alt_cmd
# add '&& \\' to all but the last line
if cmd != contents[-1]:
if cmd != contents[-1] and cmd[-1] != '\\': # ignore line that end in an escape
ln += " && \\"
ret.append(ln)
return ret
Expand Down

0 comments on commit 3e9448c

Please sign in to comment.