Skip to content

Commit

Permalink
remove square brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
Keats committed Sep 22, 2024
1 parent 45c558d commit 6798b6e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions components/markdown/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ fn convert_footnotes_to_github_style(old_events: &mut Vec<Event>) {
// nr is a number of references to this footnote
let (n, nr) = footnote_numbers.entry(name.clone()).or_insert((n, 0usize));
*nr += 1;
let reference = Event::Html(format!(r##"<sup class="footnote-reference" id="fr-{name}-{nr}"><a href="#fn-{name}">[{n}]</a></sup>"##).into());
let reference = Event::Html(format!(r##"<sup class="footnote-reference" id="fr-{name}-{nr}"><a href="#fn-{name}">{n}</a></sup>"##).into());

if footnote_bodies_stack.is_empty() {
// we are in the main text, just output the reference
Expand Down Expand Up @@ -341,7 +341,7 @@ fn convert_footnotes_to_github_style(old_events: &mut Vec<Event>) {
//
// HTML:
//
// <p>five <sup class="footnote-reference" id="fr-feet-1"><a href="#fn-feet">[1]</a></sup>.</p>
// <p>five <sup class="footnote-reference" id="fr-feet-1"><a href="#fn-feet">1</a></sup>.</p>
//
// <ol class="footnotes-list">
// <li id="fn-feet">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,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>
<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>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
source: components/markdown/tests/markdown.rs
expression: body
---
<p>This text has a footnote<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">[1]</a></sup></p>
<p>This text has two<sup class="footnote-reference" id="fr-3-1"><a href="#fn-3">[2]</a></sup> footnotes<sup class="footnote-reference" id="fr-2-1"><a href="#fn-2">[3]</a></sup>.</p>
<p>There is footnote definition?<sup class="footnote-reference" id="fr-4-1"><a href="#fn-4">[4]</a></sup></p>
<p>This text has two<sup class="footnote-reference" id="fr-5-1"><a href="#fn-5">[5]</a></sup> identical footnotes<sup class="footnote-reference" id="fr-5-2"><a href="#fn-5">[5]</a></sup></p>
<p>This text has a footnote<sup class="footnote-reference" id="fr-7-1"><a href="#fn-7">[6]</a></sup></p>
<p>Footnotes can also be referenced with identifiers<sup class="footnote-reference" id="fr-first-1"><a href="#fn-first">[8]</a></sup>.</p>
<p>This text has a footnote<sup class="footnote-reference" id="fr-1-1"><a href="#fn-1">1</a></sup></p>
<p>This text has two<sup class="footnote-reference" id="fr-3-1"><a href="#fn-3">2</a></sup> footnotes<sup class="footnote-reference" id="fr-2-1"><a href="#fn-2">3</a></sup>.</p>
<p>There is footnote definition?<sup class="footnote-reference" id="fr-4-1"><a href="#fn-4">4</a></sup></p>
<p>This text has two<sup class="footnote-reference" id="fr-5-1"><a href="#fn-5">5</a></sup> identical footnotes<sup class="footnote-reference" id="fr-5-2"><a href="#fn-5">5</a></sup></p>
<p>This text has a footnote<sup class="footnote-reference" id="fr-7-1"><a href="#fn-7">6</a></sup></p>
<p>Footnotes can also be referenced with identifiers<sup class="footnote-reference" id="fr-first-1"><a href="#fn-first">8</a></sup>.</p>
<hr><ol class="footnotes-list">
<li id="fn-1">
<p>But it is meaningless. <a href="#fr-1-1">↩</a></p>
Expand All @@ -25,7 +25,7 @@ expression: body
<p>So one is present. <a href="#fr-5-1">↩</a> <a href="#fr-5-2">↩2</a></p>
</li>
<li id="fn-7">
<p>But the footnote has another footnote<sup class="footnote-reference" id="fr-8-1"><a href="#fn-8">[7]</a></sup>. <a href="#fr-7-1">↩</a></p>
<p>But the footnote has another footnote<sup class="footnote-reference" id="fr-8-1"><a href="#fn-8">7</a></sup>. <a href="#fr-7-1">↩</a></p>
</li>
<li id="fn-8">
<p>That's it. <a href="#fr-8-1">↩</a></p>
Expand Down

0 comments on commit 6798b6e

Please sign in to comment.