aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs5
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