forked from asciidoctor/asciidoctor-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolves asciidoctor#491 support reversed option on ordered list
- implement pred method for String - implement pred method for RomanNumeral - call pred method instead of next if reversed option is set on list - switch to integer value below first char or roman numeral in sequence
- Loading branch information
1 parent
003ae90
commit 99aa655
Showing
4 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
require_relative 'core_ext/array' | ||
require_relative 'core_ext/numeric' | ||
require_relative 'core_ext/string' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class String | ||
def pred | ||
begin | ||
# integers | ||
%(#{(Integer self) - 1}) | ||
rescue ::ArgumentError | ||
# chars (lower alpha, upper alpha, lower greek) | ||
([65, 97, 945].include? ord) ? '0' : ([ord - 1].pack 'U*') | ||
end | ||
end unless respond_to? :pred | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters