summaryrefslogtreecommitdiff
path: root/spec/hyphens_spec.rb
diff options
context:
space:
mode:
authorklonfish <1299450+klonfish@users.noreply.github.com>2020-08-15 09:03:54 +0200
committerGitHub <noreply@github.com>2020-08-15 01:03:54 -0600
commitac8b5433935662605981413a6dbc49e045c3ebdf (patch)
tree75843df2d59aefb94aee7f9118be321d5f8dce87 /spec/hyphens_spec.rb
parentf5fca332230a2a8603cdce90c8f0a04e860bc45d (diff)
resolves #1715 respect hyphenation exceptions when word is adjacent to non-word character (PR #1718)
Diffstat (limited to 'spec/hyphens_spec.rb')
-rw-r--r--spec/hyphens_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/hyphens_spec.rb b/spec/hyphens_spec.rb
index 9c8e7b89..2427f829 100644
--- a/spec/hyphens_spec.rb
+++ b/spec/hyphens_spec.rb
@@ -40,6 +40,24 @@ describe 'Asciidoctor::PDF::Converter - Hyphens' do
(expect pdf.lines[0]).to end_with '-'
end
+ it 'should honor hyphenation exceptions when word is adjacent to a non-word character' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ :hyphens:
+ :lang: nl
+
+ [width=15%]
+ |===
+ | souveniertjes!
+ |===
+ EOS
+
+ (expect pdf.lines).to eql [%(souve\u00ad), 'niertjes!']
+
+ converter = Asciidoctor::Converter.create 'pdf'
+ result = converter.hyphenate_words 'souveniertjes!', (Text::Hyphen.new language: 'nl')
+ (expect result).to eql %(sou\u00adve\u00adniertjes!)
+ end
+
it 'should hyphenate text in table cell in table head if hyphens attribute is set' do
pdf = to_pdf <<~'EOS', analyze: true
:hyphens: