summaryrefslogtreecommitdiff
path: root/test/links_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/links_test.rb')
-rw-r--r--test/links_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/links_test.rb b/test/links_test.rb
index d0e1c8bc..58f5f18c 100644
--- a/test/links_test.rb
+++ b/test/links_test.rb
@@ -396,6 +396,16 @@ context 'Links' do
assert_includes output, (input.sub '{empty}', '')
end
+ test 'reftext of macro inline ref can resolve to empty' do
+ input = 'anchor:id-only[{empty}]text\n\nsee <<id-only>>'
+ doc = document_from_string input
+ assert doc.catalog[:refs].key? 'id-only'
+ output = doc.convert standalone: false
+ assert_xpath '//a[@id="id-only"]', output, 1
+ assert_xpath '//a[@href="#id-only"]', output, 1
+ assert_xpath '//a[@href="#id-only"][text()="[id-only]"]', output, 1
+ end
+
test 'inline ref with reftext' do
%w([[tigers,Tigers]] anchor:tigers[Tigers]).each do |anchor|
doc = document_from_string %(Here you can read about tigers.#{anchor})