diff options
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/SIunitx.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs index 436330d85..d16dec580 100644 --- a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs +++ b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs @@ -58,7 +58,7 @@ doSInumlist = do text ", & " <> last xs parseNum :: Parser Text () Inlines -parseNum = mconcat <$> many parseNumPart +parseNum = (mconcat <$> many parseNumPart) <* eof parseNumPart :: Parser Text () Inlines parseNumPart = @@ -71,7 +71,9 @@ parseNumPart = parseSpace where parseDecimalNum = do - basenum <- T.pack <$> many1 (satisfy (\c -> isDigit c || c == '.')) + pref <- option mempty $ (mempty <$ char '+') <|> ("-" <$ char '-') + basenum <- (pref <>) . T.pack + <$> many1 (satisfy (\c -> isDigit c || c == '.')) uncertainty <- option mempty $ T.pack <$> parseParens if T.null uncertainty then return $ str basenum |