From 8735bc03d8b9da1663f696dc348342c0e424a141 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 27 Jul 2025 10:40:06 -0700 Subject: 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. --- src/Text/Pandoc/Readers/Docx/Parse/Styles.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs b/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs index 050bfecbc..a23f99c55 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs @@ -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 -- cgit v1.2.3