summaryrefslogtreecommitdiff
path: root/smartypants.py
diff options
context:
space:
mode:
authorYu-Jie Lin <livibetter@gmail.com>2013-08-12 10:22:01 +0800
committerYu-Jie Lin <livibetter@gmail.com>2013-08-12 10:22:01 +0800
commit9cbb19a3e9cba68b474221ea575f9bd410548be5 (patch)
treef9f1bc4c818e8bc6e26c84f8e09976788051c29b /smartypants.py
parent736735b1bcf7c76d1aa9c129d1268841686dd079 (diff)
downloadsmartypants-9cbb19a3e9cba68b474221ea575f9bd410548be5.tar.gz
fix convert_quote, it was also turned on since False != "0"
Diffstat (limited to 'smartypants.py')
-rwxr-xr-xsmartypants.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/smartypants.py b/smartypants.py
index d4f51b6..a705d9b 100755
--- a/smartypants.py
+++ b/smartypants.py
@@ -57,7 +57,7 @@ def cb_story(args):
def smartyPants(text, attr=default_smartypants_attr):
# should we translate &quot; entities into normal quotes?
- convert_quot = False
+ convert_quot = 0
# Parse attributes:
# 0 : do nothing
@@ -122,7 +122,7 @@ def smartyPants(text, attr=default_smartypants_attr):
elif c == "e":
do_ellipses = 1
elif c == "w":
- convert_quot = "1"
+ convert_quot = 1
else:
pass
# ignore unknown option
@@ -167,7 +167,7 @@ def smartyPants(text, attr=default_smartypants_attr):
if not in_pre:
t = processEscapes(t)
- if convert_quot != "0":
+ if convert_quot:
t = re.sub('&quot;', '"', t)
if do_dashes: