summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-10-11 01:31:11 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-10-11 01:31:11 -0600
commit679bed4153cedb5662326a6d126d4247c3680f25 (patch)
tree110b5e75d75abcea872a932a86ba859ab55c0cfb
parent7f2b05e1de8575549bfc382fcb781aa5525aefc2 (diff)
ensure character references are properly decoded in toc
-rw-r--r--spec/outline_spec.rb2
-rw-r--r--spec/toc_spec.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/outline_spec.rb b/spec/outline_spec.rb
index 7117f5ea..1d5fbade 100644
--- a/spec/outline_spec.rb
+++ b/spec/outline_spec.rb
@@ -177,7 +177,7 @@ describe 'Asciidoctor::PDF::Converter - Outline' do
(expect outline[1][:title]).to eql 'First Chapter'
end
- it 'should decode character references in titles' do
+ it 'should decode character references in entries' do
pdf = to_pdf <<~'EOS', doctype: :book
= ACME(TM) Catalog <&#8470;&nbsp;1>
diff --git a/spec/toc_spec.rb b/spec/toc_spec.rb
index cf50c02a..3d6f808d 100644
--- a/spec/toc_spec.rb
+++ b/spec/toc_spec.rb
@@ -456,4 +456,15 @@ describe 'Asciidoctor::PDF::Converter - TOC' do
(expect to_file).to visually_match 'toc-running-content-font-color.pdf'
end
+
+ it 'should decode character references in toc entries' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ = Document Title
+ :toc:
+
+ == Paper Clips &#x2116;&nbsp;4
+ EOS
+
+ (expect pdf.find_text %(Paper Clips \u2116\u00a04)).to have_size 2
+ end
end