aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-22 12:05:34 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-22 12:05:34 -0700
commit0327226d4c8976bd997fd00dea1faf4120905c27 (patch)
tree47b4631826074209a00f891c6cbaeed7a32b53ff /src/Text/Pandoc
parent7a111d2d334687b3a099d260ffd6bf774453d273 (diff)
downloadpandoc-0327226d4c8976bd997fd00dea1faf4120905c27.tar.gz
Man reader: don't parse \[ul] as unicode escape.
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