aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-04-15 19:53:11 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-04-15 19:53:58 -0700
commit7f036c0b57f2791c03040bed61e55adcd21ee496 (patch)
treeff7a0442bdf613002bb64c61b982bf298071cd24 /src/Text/Pandoc
parentd8d4ede4d66d85f81106a97ddc66927c2038b2d0 (diff)
downloadpandoc-7f036c0b57f2791c03040bed61e55adcd21ee496.tar.gz
Shared: Fixed bug in toRomanNumeral.
9 and numbers ending in 9 would end with "IXIV." Thanks to Jesse Rosenthal. Closes #1249.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Shared.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 3835629db..27ef6a579 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -234,9 +234,9 @@ toRomanNumeral x =
_ | x >= 50 -> "L" ++ toRomanNumeral (x - 50)
_ | x >= 40 -> "XL" ++ toRomanNumeral (x - 40)
_ | x >= 10 -> "X" ++ toRomanNumeral (x - 10)
- _ | x >= 9 -> "IX" ++ toRomanNumeral (x - 5)
+ _ | x == 9 -> "IX"
_ | x >= 5 -> "V" ++ toRomanNumeral (x - 5)
- _ | x >= 4 -> "IV" ++ toRomanNumeral (x - 4)
+ _ | x == 4 -> "IV"
_ | x >= 1 -> "I" ++ toRomanNumeral (x - 1)
_ -> ""