File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1981,6 +1981,13 @@ def _do_smart_punctuation(self, text):
1981
1981
text = text .replace ("..." , "…" )
1982
1982
text = text .replace (" . . . " , "…" )
1983
1983
text = text .replace (". . ." , "…" )
1984
+
1985
+ # TODO: Temporary hack to fix https://github.com/trentm/python-markdown2/issues/150
1986
+ if "footnotes" in self .extras and "footnote-ref" in text :
1987
+ # Quotes in the footnote back ref get converted to "smart" quotes
1988
+ # Change them back here to ensure they work.
1989
+ text = text .replace ('class="footnote-ref”' , 'class="footnote-ref"' )
1990
+
1984
1991
return text
1985
1992
1986
1993
_block_quote_base = r'''
Original file line number Diff line number Diff line change
1
+ < p > This is a para with a footnote.< sup class ="footnote-ref " id ="fnref-1 "> < a href ="#fn-1 "> 1</ a > </ sup > </ p >
2
+
3
+ < div class ="footnotes ">
4
+ < hr />
5
+ < ol >
6
+ < li id ="fn-1 ">
7
+ < p > Here is the < em > body</ em > of < span class ="yo "> the</ span > footnote.</ p >
8
+
9
+ < div class ="blah "> And here is the second para of the footnote.</ div >
10
+
11
+ < p > < a href ="#fnref-1 " class ="footnoteBackLink " title ="Jump back to footnote 1 in the text. "> ↩</ a > </ p >
12
+ </ li >
13
+ </ ol >
14
+ </ div >
Original file line number Diff line number Diff line change
1
+ {"extras": ["footnotes", "smarty-pants"]}
Original file line number Diff line number Diff line change
1
+ This is a para with a footnote.[^1]
2
+
3
+ [^1]: Here is the <em>body</em> of <span class="yo">the</span> footnote.
4
+
5
+ <div class="blah">And here is the second para of the footnote.</div>
You can’t perform that action at this time.
0 commit comments