diff options
| author | John MacFarlane <[email protected]> | 2024-06-21 11:14:31 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-06-21 11:14:31 -0700 |
| commit | 7786b72584a1e485063e69aaa8483eb93100b290 (patch) | |
| tree | 615970e5fe95ca63e67e64b5305d24adebc2a57b /src | |
| parent | 59781abef48f115afaf87c5290d5acc287d09a45 (diff) | |
LaTeX reader: fix parsing of dimensions beginning with `.`.
E.g., `\kern.1pt`.
Closes #9902.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 90190c082..e5382e306 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -885,7 +885,12 @@ dimenarg = try $ do optional sp ch <- option False $ True <$ symbol '=' minus <- option "" $ "-" <$ symbol '-' - Tok _ _ s1 <- satisfyTok isWordTok + s1 <- option "" + (do Tok _ _ s1 <- satisfyTok isWordTok + guard (case T.uncons s1 of + Just (c,_) -> isDigit c + Nothing -> False) + pure s1) s2 <- option "" $ try $ do symbol '.' Tok _ _ t <- satisfyTok isWordTok |
