summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMarat Radchenko <marat@slonopotamus.org>2020-03-03 19:25:14 +0300
committerGitHub <noreply@github.com>2020-03-03 19:25:14 +0300
commitdd385951469d0fd7a1636d80d5789ff1ca850331 (patch)
tree38736111216d1fac3bca8acf471b8237bc5dba90 /spec
parent4cd42617d1a35993b323093a631fe5d3acfb0f00 (diff)
resolves #317 add xref ids to paragraphs (#319)
Diffstat (limited to 'spec')
-rw-r--r--spec/xref_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/xref_spec.rb b/spec/xref_spec.rb
index e2a2f56..278add5 100644
--- a/spec/xref_spec.rb
+++ b/spec/xref_spec.rb
@@ -49,6 +49,20 @@ describe 'Asciidoctor::Epub3::Converter - Xref' do
expect(chapter.content).to include '<a id="xref--bibliography--pp" href="bibliography.xhtml#pp" class="xref">[pp]</a>'
end
+ it 'adds xref id to paragraph' do
+ book = to_epub <<~EOS
+= Article
+
+[id=anchor]
+Text
+
+More text
+ EOS
+ article = book.item_by_href '_article.xhtml'
+ expect(article).not_to be_nil
+ expect(article.content).to include '<p id="anchor">Text</p>'
+ end
+
it 'displays anchor text' do
book = to_epub <<~EOS
= Article