diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-09-05 04:42:25 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-09-05 04:42:25 -0600 |
| commit | a05b876ea84ad0c233d6a272ed57f1bca3bd1679 (patch) | |
| tree | 166b7524f5e5c4ace31b520dba7885cd7367d62b /lib | |
| parent | eab695598a655e5a6ce5584406d46d45fee1d3c8 (diff) | |
fix collation order of index terms that differ only in case
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/asciidoctor/pdf/index_catalog.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/asciidoctor/pdf/index_catalog.rb b/lib/asciidoctor/pdf/index_catalog.rb index 77ced72a..b07809fa 100644 --- a/lib/asciidoctor/pdf/index_catalog.rb +++ b/lib/asciidoctor/pdf/index_catalog.rb @@ -94,7 +94,13 @@ module Asciidoctor end def <=> other - (val = @name.casecmp other.name) == 0 ? @name <=> other.name : val + if IndexTermCategory === self + @name <=> other.name + elsif (val = @name.casecmp other.name) == 0 + other.name <=> @name + else + val + end end end |
