mirror of
https://github.com/jgm/pandoc.git
synced 2026-07-15 05:47:10 +00:00
Docx reader: fix stringToInteger.
It previously converted things like `11ccc` to an integer; now it requires that the whole string be parsable as an integer. Closes #9184.
This commit is contained in:
@@ -239,8 +239,8 @@ buildBasedOnList ns element rootStyle =
|
||||
|
||||
stringToInteger :: Text -> Maybe Integer
|
||||
stringToInteger s = case Data.Text.Read.decimal s of
|
||||
Right (x,_) -> Just x
|
||||
Left _ -> Nothing
|
||||
Right (x,t) | T.null t -> Just x
|
||||
_ -> Nothing
|
||||
|
||||
checkOnOff :: NameSpaces -> Element -> QName -> Maybe Bool
|
||||
checkOnOff ns rPr tag
|
||||
|
||||
Reference in New Issue
Block a user