summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-04-09 15:07:46 -0600
committerGitHub <noreply@github.com>2021-04-09 15:07:46 -0600
commitac3391dba2ff630760a67b945ff93aa1876004d9 (patch)
tree0846e85345b638fd5b84d51706f1268e9ea159f8 /lib
parent15a6fe6fe4ceea69c62d68f612836ca6c378e7f4 (diff)
resolves #3940 fix crash when resolving next value in sequence for non-numeric counter (PR #4003)
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/helpers.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/asciidoctor/helpers.rb b/lib/asciidoctor/helpers.rb
index fb56bd4d..789cafe0 100644
--- a/lib/asciidoctor/helpers.rb
+++ b/lib/asciidoctor/helpers.rb
@@ -274,13 +274,10 @@ module Helpers
def nextval current
if ::Integer === current
current + 1
+ elsif (intval = current.to_i).to_s == current.to_s
+ intval + 1
else
- intval = current.to_i
- if intval.to_s != current.to_s
- (current[0].ord + 1).chr
- else
- intval + 1
- end
+ current.succ
end
end