diff options
author | Isaac Muse <faceless.shop@gmail.com> | 2017-01-23 20:44:40 -0700 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2017-01-23 22:44:40 -0500 |
commit | facfd66d5e41e03d69901fe2f4ae0e24106a21f2 (patch) | |
tree | d9d51d6626aaad152e97ca07e2872c2c0d73756e /tests/extensions/extra | |
parent | 8afeaafcb06c07058e1f296e3d3867048c01d18c (diff) | |
download | markdown-facfd66d5e41e03d69901fe2f4ae0e24106a21f2.tar.gz markdown-facfd66d5e41e03d69901fe2f4ae0e24106a21f2.tar.bz2 markdown-facfd66d5e41e03d69901fe2f4ae0e24106a21f2.zip |
Fix footnote parsing of footnote content (#536)
Fixes #412 and #493. First we parse footnote content as
its own document avoid quirks with using li as a parent. Second, we
surround placeholders with STX and ETX to prevent them from interfering
with inline parsing; this is also consistent with how placeholders are
used everywhere else in Python Markdown.
Diffstat (limited to 'tests/extensions/extra')
-rw-r--r-- | tests/extensions/extra/footnote.html | 26 | ||||
-rw-r--r-- | tests/extensions/extra/footnote.txt | 32 |
2 files changed, 58 insertions, 0 deletions
diff --git a/tests/extensions/extra/footnote.html b/tests/extensions/extra/footnote.html index 9cf42ed..4cca25c 100644 --- a/tests/extensions/extra/footnote.html +++ b/tests/extensions/extra/footnote.html @@ -3,6 +3,8 @@ <p>Duplicate<sup id="fnref:a"><a class="footnote-ref" href="#fn:a" rel="footnote">6</a></sup> footnotes<sup id="fnref2:a"><a class="footnote-ref" href="#fn:a" rel="footnote">6</a></sup> test<sup id="fnref3:a"><a class="footnote-ref" href="#fn:a" rel="footnote">6</a></sup>.</p> <p>Duplicate<sup id="fnref:b"><a class="footnote-ref" href="#fn:b" rel="footnote">7</a></sup> footnotes<sup id="fnref2:b"><a class="footnote-ref" href="#fn:b" rel="footnote">7</a></sup> test<sup id="fnref3:b"><a class="footnote-ref" href="#fn:b" rel="footnote">7</a></sup>.</p> <p>Single after duplicates<sup id="fnref:c"><a class="footnote-ref" href="#fn:c" rel="footnote">8</a></sup>.</p> +<p>Test emphasis at end of footnote<sup id="fnref:d"><a class="footnote-ref" href="#fn:d" rel="footnote">9</a></sup></p> +<p>Complex footnote content<sup id="fnref:e"><a class="footnote-ref" href="#fn:e" rel="footnote">10</a></sup></p> <div class="footnote"> <hr /> <ol> @@ -41,5 +43,29 @@ Nor is third... <a class="footnote-backref" href="#fnref:5" rev="footnote" <li id="fn:c"> <p>3 <a class="footnote-backref" href="#fnref:c" rev="footnote" title="Jump back to footnote 8 in the text">↩</a></p> </li> +<li id="fn:d"> +<p><em>emphasis works</em></p> +<p><em>emphasis still works</em> <a class="footnote-backref" href="#fnref:d" rev="footnote" title="Jump back to footnote 9 in the text">↩</a></p> +</li> +<li id="fn:e"> +<ol> +<li> +<p>The top couple half figure, contrary sides and hands across with bottom couple,</p> +<p>Half figure back on your own sides, and turn partner to places,</p> +<p>Swing partners with right hands into straight line long-ways, as in a reel, and</p> +<p>Set,</p> +<p>Hey and return to places,</p> +<p>The other three couples do the same.</p> +</li> +<li> +<p>Top and bottom couples meet and set,</p> +<p>Then each gentleman leas the opposite lady to the couple on his left, and set,</p> +<p>Aach four right and left,</p> +<p>Swing side couples to places, and turn partners all eight,</p> +<p>The other two couple o the same.</p> +</li> +</ol> +<p><a class="footnote-backref" href="#fnref:e" rev="footnote" title="Jump back to footnote 10 in the text">↩</a></p> +</li> </ol> </div>
\ No newline at end of file diff --git a/tests/extensions/extra/footnote.txt b/tests/extensions/extra/footnote.txt index f95ff2c..93b5869 100644 --- a/tests/extensions/extra/footnote.txt +++ b/tests/extensions/extra/footnote.txt @@ -8,6 +8,10 @@ Duplicate[^b] footnotes[^b] test[^b]. Single after duplicates[^c]. +Test emphasis at end of footnote[^d] + +Complex footnote content[^e] + [^1]: Footnote that ends with a list: * item 1 @@ -28,3 +32,31 @@ Nor is third... [^a]: 1 [^b]: 2 [^c]: 3 + +[^d]: + _emphasis works_ + + _emphasis still works_ + +[^e]: + 1. The top couple half figure, contrary sides and hands across with bottom couple, + + Half figure back on your own sides, and turn partner to places, + + Swing partners with right hands into straight line long-ways, as in a reel, and + + Set, + + Hey and return to places, + + The other three couples do the same. + + 2. Top and bottom couples meet and set, + + Then each gentleman leas the opposite lady to the couple on his left, and set, + + Aach four right and left, + + Swing side couples to places, and turn partners all eight, + + The other two couple o the same. |