summaryrefslogtreecommitdiff
path: root/test/substitutions_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-06-28 23:51:15 -0600
committerGitHub <noreply@github.com>2020-06-28 23:51:15 -0600
commit1cde78f91aca9b7c9ca542ad118f6a736a12c693 (patch)
tree589c53421d7d6e01822c8d46e525256e4f7e9cf6 /test/substitutions_test.rb
parentcb7c20593344bda9bc968a619b02065d3401ad29 (diff)
resolves #3690 don't register footnote with ID if a footnote is already registered with that ID (PR #3691)
Diffstat (limited to 'test/substitutions_test.rb')
-rw-r--r--test/substitutions_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/substitutions_test.rb b/test/substitutions_test.rb
index 3f4eddf0..bfd6f51a 100644
--- a/test/substitutions_test.rb
+++ b/test/substitutions_test.rb
@@ -1092,6 +1092,20 @@ context 'Substitutions' do
assert_css '#footnotes .footnote', output, 1
end
+ test 'should not register footnote with id and text if id already registered' do
+ input = <<~'EOS'
+ :fn-notable-text: footnote:id[about this text]
+
+ notable text.{fn-notable-text}
+
+ more notable text.{fn-notable-text}
+ EOS
+ output = convert_string_to_embedded input
+ assert_xpath '(//p)[1]/sup[@class="footnote"]', output, 1
+ assert_xpath '(//p)[2]/sup[@class="footnoteref"]', output, 1
+ assert_css '#footnotes .footnote', output, 1
+ end
+
test 'should not resolve an inline footnote macro missing both id and text' do
input = <<~'EOS'
The footnote:[] macro can be used for defining and referencing footnotes.