From 8abcf059b097255cf3866f366f77c7c5c4ea6c20 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Sun, 14 Oct 2018 21:48:06 -0700 Subject: [PATCH] Escape curly braces to avoid substitution error during formatting --- src/article.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/article.py b/src/article.py index a4aeffc..bbab806 100644 --- a/src/article.py +++ b/src/article.py @@ -76,6 +76,9 @@ class LexiconArticle: # Escape angle brackets para = re.sub("<", "<", para) para = re.sub(">", ">", para) + # Escape curly braces + para = re.sub("{", "{", para) + para = re.sub("}", "}", para) # Replace bold and italic marks with tags para = re.sub(r"//([^/]+)//", r"\1", para) para = re.sub(r"\*\*([^*]+)\*\*", r"\1", para)