aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index 6916e56db..96d31b9d1 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -204,9 +204,11 @@ escapeLexer = try $ do
<|> charCode `sepBy1` (many1 Parsec.space)
) <* char ']'
- ucharCode = do
+ ucharCode = try $ do
char 'u'
cs <- many1 (satisfy isHexDigit)
+ let lcs = length cs
+ guard $ lcs >= 4 && lcs <= 6
case chr <$> safeRead ('0':'x':cs) of
Nothing -> escUnknown ("\\[u" ++ cs ++ "]") '\xFFFD'
Just c -> return c