Fix escapes

If you want to include a literal ${macro call}, you can preface it with
a backslash like \${macro call}.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-09-22 10:21:47 -07:00
parent e566b2e956
commit 068cb6d35b

View File

@@ -96,10 +96,14 @@ class MarkupParser:
def parse(self): def parse(self):
while self.c: while self.c:
if self.c in r"\$": if self.is_match("${"):
mac = self.parse_macro() mac = self.parse_macro()
self.parts += [mac] self.parts += [mac]
else: else:
# skip past the escape
if self.is_match(r"\${"):
self.adv(3)
self.parts += [MarkupRaw("${")]
raw = self.parse_raw() raw = self.parse_raw()
self.parts += [raw] self.parts += [raw]