diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-08-17 22:11:31 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-08-17 22:11:31 -0700 |
commit | 159863e8dad24e98be3478867d0f8ea63b2a764b (patch) | |
tree | 698b0e8027f84f7bb06ff655f012a56e6675e79a /src/Text | |
parent | 4ec02053bba3f280b63267c90f2faeafe74d5c64 (diff) | |
download | pandoc-159863e8dad24e98be3478867d0f8ea63b2a764b.tar.gz |
LaTeX reader: use combining characters when needed for accents.
For example, there is no unicode code point corresponding to
\"{X}, so we use a combining accent.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 44b93439d..cafa55f57 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1073,7 +1073,10 @@ accent :: PandocMonad m => Char -> (Char -> String) -> LP m Inlines accent c f = try $ do ils <- tok case toList ils of - (Str (x:xs) : ys) -> return $ fromList (Str (f x ++ xs) : ys) + (Str (x:xs) : ys) -> return $ fromList $ + case f x of + [z] | z == x -> Str ([z,c] ++ xs) : ys -- combining accent + zs -> Str (zs ++ xs) : ys [Space] -> return $ str [c] [] -> return $ str [c] _ -> return ils |