diff --git a/src/velocity/_backends.py b/src/velocity/_backends.py index e62174d..b7384f3 100644 --- a/src/velocity/_backends.py +++ b/src/velocity/_backends.py @@ -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 = "" @@ -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