aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2016-10-14 13:56:24 +0200
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2016-10-14 13:56:24 +0200
commit9282fadc6bc6c56a7f81ba48b75c827dc92eae2e (patch)
tree4d7e8e0853137c666ab8b14ff81a00084e78c235 /src
parentedc951ee7d43f9ef548686ef9ba82380f7235d2b (diff)
downloadpandoc-9282fadc6bc6c56a7f81ba48b75c827dc92eae2e.tar.gz
Added tests and a corner case for starting number
Review revealed that we didn't handle the case when the starting point is an empty string. While this is not a valid .odt file, we simply added a special case to deal with it. Also added tests for the new feature.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Odt/StyleReader.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/StyleReader.hs b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
index 77f47db29..26ba6df82 100644
--- a/src/Text/Pandoc/Readers/Odt/StyleReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
@@ -591,6 +591,7 @@ readListLevelStyle levelType = readAttr NsText "level"
toListLevelStyle _ p s LinfNone b = ListLevelStyle LltBullet p s LinfNone (startValue b)
toListLevelStyle _ p s f@(LinfString _) b = ListLevelStyle LltBullet p s f (startValue b)
toListLevelStyle t p s f b = ListLevelStyle t p s f (startValue b)
+ startValue (Just "") = 1
startValue (Just v) = if all isDigit v
then read v
else 1