aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-12-17 10:19:36 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-12-17 10:19:36 -0800
commit15d3cf80703769abc8443a73a56acae8c7f5687e (patch)
treeef1eb6443d2b65315eaf654935f0e9fbffd89132 /src
parent4dc732f28f0d07a0f33d71421db09feb95e2f36d (diff)
downloadpandoc-15d3cf80703769abc8443a73a56acae8c7f5687e.tar.gz
HTML reader: handle empty start attribute.
See #5162.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index b668641c8..b27840eb5 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -49,7 +49,7 @@ import Control.Arrow (first)
import Control.Monad (guard, mplus, msum, mzero, unless, void)
import Control.Monad.Except (throwError)
import Control.Monad.Reader (ReaderT, ask, asks, lift, local, runReaderT)
-import Data.Char (isAlphaNum, isDigit, isLetter)
+import Data.Char (isAlphaNum, isLetter)
import Data.Default (Default (..), def)
import Data.Foldable (for_)
import Data.List (isPrefixOf)
@@ -319,9 +319,7 @@ pOrderedList = try $ do
let (start, style) = (sta', sty')
where sta = fromMaybe "1" $
lookup "start" attribs
- sta' = if all isDigit sta
- then read sta
- else 1
+ sta' = fromMaybe 1 $ safeRead sta
pickListStyle = pickStyleAttrProps ["list-style-type", "list-style"]