From 15d3cf80703769abc8443a73a56acae8c7f5687e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 17 Dec 2018 10:19:36 -0800 Subject: HTML reader: handle empty start attribute. See #5162. --- src/Text/Pandoc/Readers/HTML.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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"] -- cgit v1.2.3