summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-09-05 04:37:36 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-09-05 04:38:13 -0600
commiteab695598a655e5a6ce5584406d46d45fee1d3c8 (patch)
treeeb63ed95ae2154ebe04bc041758d7d39de9bff85 /lib
parente7f79c606ef6c3c057f53d03c24928aa454818f3 (diff)
compute category name in IndexCatalog#init_category method
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/pdf/index_catalog.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/asciidoctor/pdf/index_catalog.rb b/lib/asciidoctor/pdf/index_catalog.rb
index 531d68ce..77ced72a 100644
--- a/lib/asciidoctor/pdf/index_catalog.rb
+++ b/lib/asciidoctor/pdf/index_catalog.rb
@@ -32,7 +32,7 @@ module Asciidoctor
def store_primary_term name, dest = nil
store_dest dest if dest
- (init_category name.chr.upcase).store_term name, dest
+ (init_category name).store_term name, dest
end
def store_secondary_term primary_name, secondary_name, dest = nil
@@ -45,8 +45,8 @@ module Asciidoctor
(store_secondary_term primary_name, secondary_name).store_term tertiary_name, dest
end
- def init_category name
- name = '@' unless LeadingAlphaRx.match? name
+ def init_category term
+ name = (LeadingAlphaRx.match? term) ? term.chr.upcase : '@'
@categories[name] ||= IndexTermCategory.new name
end