diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-22 12:05:34 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-22 12:05:34 -0700 |
commit | 0327226d4c8976bd997fd00dea1faf4120905c27 (patch) | |
tree | 47b4631826074209a00f891c6cbaeed7a32b53ff /src/Text/Pandoc | |
parent | 7a111d2d334687b3a099d260ffd6bf774453d273 (diff) | |
download | pandoc-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.hs | 4 |
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 |