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:
@@ -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]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user