diff --git a/lib/markdown2.py b/lib/markdown2.py index f64f5551..534812bb 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -1981,6 +1981,13 @@ def _do_smart_punctuation(self, text): text = text.replace("...", "…") text = text.replace(" . . . ", "…") text = text.replace(". . .", "…") + + # TODO: See issue #150 + if "footnotes" in self.extras and "footnote-ref" in text: + # Quotes in the footnote back ref get converted to "smart" quotes + # Change them back here to ensure they work. + text = text.replace('class="footnote-ref”', 'class="footnote-ref"') + return text _block_quote_base = r''' diff --git a/test/tm-cases/footnotes_smarty-pants.html b/test/tm-cases/footnotes_smarty-pants.html new file mode 100644 index 00000000..b48e23a6 --- /dev/null +++ b/test/tm-cases/footnotes_smarty-pants.html @@ -0,0 +1,14 @@ +

This is a para with a footnote.1

+ +
+
+
    +
  1. +

    Here is the body of the footnote.

    + +
    And here is the second para of the footnote.
    + +

    +
  2. +
+
diff --git a/test/tm-cases/footnotes_smarty-pants.opts b/test/tm-cases/footnotes_smarty-pants.opts new file mode 100644 index 00000000..2deeb86d --- /dev/null +++ b/test/tm-cases/footnotes_smarty-pants.opts @@ -0,0 +1 @@ +{"extras": ["footnotes", "smarty-pants"]} diff --git a/test/tm-cases/footnotes_smarty-pants.text b/test/tm-cases/footnotes_smarty-pants.text new file mode 100644 index 00000000..27470d1e --- /dev/null +++ b/test/tm-cases/footnotes_smarty-pants.text @@ -0,0 +1,5 @@ +This is a para with a footnote.[^1] + +[^1]: Here is the body of the footnote. + +
And here is the second para of the footnote.