From 9659aff9628debd7acc51f3b0479b730396c00e3 Mon Sep 17 00:00:00 2001 From: Geoff Date: Sat, 10 Sep 2016 17:25:43 -0400 Subject: [PATCH] Don't munge new-format() style placeholders also includes @jiaaro's PR: https://github.com/jacobb/poxx/pull/2 --- poxx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poxx.py b/poxx.py index d907615..a38b024 100755 --- a/poxx.py +++ b/poxx.py @@ -78,7 +78,7 @@ def handle_endtag(self, tag): def handle_data(self, data): # We don't want to munge placeholders, so split on them, keeping them # in the list, then xform every other token. - toks = re.split(r"(%\(\w+\)s)", data) + toks = re.split(r"((?:%(?:\(\w+\))?s)|(?:\{\w+\}))", data) for i, tok in enumerate(toks): if i % 2: self.s += tok