-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented bottom footnotes with backreferences (#2480)
* Implemented bottom footnotes with backreferences Fixes #1285 * Added bottom_footnotes option to configuration.md * Renamed fix_github_style_footnotes() * Added tests for convert_footnotes_to_github_style() * Changed test to plain html instead of Vec<Event> * Added integration test for footnotes * Applied suggested changes
- Loading branch information
Showing
11 changed files
with
403 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: components/markdown/src/markdown.rs | ||
expression: html | ||
--- | ||
<p>There is footnote definition?<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">[1]</a></sup></p> | ||
<hr><ol class="footnotes-list"> | ||
<li id="fn-1"> | ||
<p>It's before the reference. <a href="#fr-1-1">↩</a></p> | ||
</li> | ||
</ol> |
13 changes: 13 additions & 0 deletions
13
components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: components/markdown/src/markdown.rs | ||
expression: html | ||
--- | ||
<p>This text has a footnote<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">[1]</a></sup></p> | ||
<hr><ol class="footnotes-list"> | ||
<li id="fn-1"> | ||
<p>But the footnote has another footnote<sup class="footnote-reference" id="fr-2-1"><a href="#fn-2">[2]</a></sup>. <a href="#fr-1-1">↩</a></p> | ||
</li> | ||
<li id="fn-2"> | ||
<p>That's it. <a href="#fr-2-1">↩</a></p> | ||
</li> | ||
</ol> |
10 changes: 10 additions & 0 deletions
10
components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: components/markdown/src/markdown.rs | ||
expression: html | ||
--- | ||
<p>This text has two<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">[1]</a></sup> identical footnotes<sup class="footnote-reference" id="fr-1-2"><a href="#fn-1">[1]</a></sup></p> | ||
<hr><ol class="footnotes-list"> | ||
<li id="fn-1"> | ||
<p>So one is present. <a href="#fr-1-1">↩</a> <a href="#fr-1-2">↩2</a></p> | ||
</li> | ||
</ol> |
6 changes: 6 additions & 0 deletions
6
components/markdown/src/snapshots/markdown__markdown__tests__no_footnotes.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
source: components/markdown/src/markdown.rs | ||
expression: html | ||
--- | ||
<p>Some text <em>without</em> footnotes.</p> | ||
<p>Only <del>fancy</del> formatting.</p> |
13 changes: 13 additions & 0 deletions
13
components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: components/markdown/src/markdown.rs | ||
expression: html | ||
--- | ||
<p>This text has two<sup class="footnote-reference" id="fr-2-1"><a href="#fn-2">[1]</a></sup> footnotes<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">[2]</a></sup></p> | ||
<hr><ol class="footnotes-list"> | ||
<li id="fn-2"> | ||
<p>But they are <a href="#fr-2-1">↩</a></p> | ||
</li> | ||
<li id="fn-1"> | ||
<p>not sorted. <a href="#fr-1-1">↩</a></p> | ||
</li> | ||
</ol> |
10 changes: 10 additions & 0 deletions
10
components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: components/markdown/src/markdown.rs | ||
expression: html | ||
--- | ||
<p>This text has a footnote<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">[1]</a></sup></p> | ||
<hr><ol class="footnotes-list"> | ||
<li id="fn-1"> | ||
<p>But it is meaningless. <a href="#fr-1-1">↩</a></p> | ||
</li> | ||
</ol> |
Oops, something went wrong.