diff --git a/CHANGES.md b/CHANGES.md index d4cbf5ef..619a95f9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ - [pull #607] Fix `middle-word-em` extra preventing strongs from being recognized (#606) - [pull #609] Add option to output to file in CLI (#608) - [pull #612] Fix footnote labels appearing out-of-order (#536) +- [pull #613] Fix smarty pants extra not triggering when it should (#611) ## python-markdown2 2.5.1 diff --git a/lib/markdown2.py b/lib/markdown2.py index f2c6cc28..dd007144 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -3321,7 +3321,13 @@ def run(self, text): return text def test(self, text): - return "'" in text or '"' in text + return any(i in text for i in ( + "'", + '"', + '--', + '...', + '. . .' + )) class Strike(Extra): diff --git a/test/tm-cases/smarty_pants_issue611.html b/test/tm-cases/smarty_pants_issue611.html new file mode 100644 index 00000000..b926e73d --- /dev/null +++ b/test/tm-cases/smarty_pants_issue611.html @@ -0,0 +1,3 @@ +

ho ho — ho ho

+ +

ho “ho” — ho ho

diff --git a/test/tm-cases/smarty_pants_issue611.opts b/test/tm-cases/smarty_pants_issue611.opts new file mode 100644 index 00000000..d0390c68 --- /dev/null +++ b/test/tm-cases/smarty_pants_issue611.opts @@ -0,0 +1 @@ +{"extras": ["smarty-pants"]} diff --git a/test/tm-cases/smarty_pants_issue611.text b/test/tm-cases/smarty_pants_issue611.text new file mode 100644 index 00000000..d0ec3d27 --- /dev/null +++ b/test/tm-cases/smarty_pants_issue611.text @@ -0,0 +1,3 @@ +ho ho --- ho ho + +ho "ho" --- ho ho \ No newline at end of file