summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/xref_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/xref_spec.rb b/spec/xref_spec.rb
index 4dc88a4..f6ec8bc 100644
--- a/spec/xref_spec.rb
+++ b/spec/xref_spec.rb
@@ -47,5 +47,18 @@ describe 'Asciidoctor::Epub3::Converter - Xref' do
expect(chapter).not_to be_nil
expect(chapter.content).to include '<a id="xref--bibliography--pp" href="bibliography.xhtml#pp" class="xref">[pp]</a>'
end
+
+ it 'displays anchor text' do
+ book = to_epub <<~EOS
+= Article
+
+<<_subsection,link text>>
+
+== Subsection
+ EOS
+ article = book.item_by_href '_article.xhtml'
+ expect(article).not_to be_nil
+ expect(article.content).to include '<a id="xref-_subsection" href="#_subsection" class="xref">link text</a>'
+ end
end
end