@@ -322,40 +322,41 @@ data StringContext = TextString
322322stringToLaTeX :: PandocMonad m => StringContext -> String -> LW m String
323323stringToLaTeX context zs = do
324324 opts <- gets stOptions
325− go opts context $
325+ return $
326+ go opts context $
326327 if writerPreferAscii opts
327328 then T.unpack $ Normalize.normalize Normalize.NFD $ T.pack zs
328329 else zs
329330 where
330− go _ _ [] = return ""
331− go opts ctx (x:xs) = do
331+ go _ _ [] = ""
332+ go opts ctx (x:xs) =
332333 let ligatures = isEnabled Ext_smart opts && ctx == TextString
333− let isUrl = ctx == URLString
334− let mbAccentCmd =
334+ isUrl = ctx == URLString
335+ mbAccentCmd =
335336 if writerPreferAscii opts && ctx == TextString
336337 then uncons xs >>= \(c,_) -> M.lookup c accents
337338 else Nothing
338− let emits s =
339+ emits s =
339340 case mbAccentCmd of
340− Just cmd -> ((cmd ++ "{" ++ s ++ "}") ++)
341− <$> go opts ctx (drop 1 xs) -- drop combining accent
342− Nothing -> (s++) <$> go opts ctx xs
343− let emitc c =
341+ Just cmd -> (cmd ++ "{" ++ s ++ "}") ++
342+ go opts ctx (drop 1 xs) -- drop combining accent
343+ Nothing -> s ++ go opts ctx xs
344+ emitc c =
344345 case mbAccentCmd of
345− Just cmd -> ((cmd ++ "{" ++ [c] ++ "}") ++)
346− <$> go opts ctx (drop 1 xs) -- drop combining accent
347− Nothing -> (c:) <$> go opts ctx xs
348− let emitcseq cs = do
349− rest <- go opts ctx xs
346+ Just cmd -> cmd ++ "{" ++ [c] ++ "}" ++
347+ go opts ctx (drop 1 xs) -- drop combining accent
348+ Nothing -> c : go opts ctx xs
349+ emitcseq cs = do
350+ let rest = go opts ctx xs
350351 case rest of
351352 c:_ | isLetter c
352353 , ctx == TextString
353− -> return (cs <> " " <> rest)
354− | isSpace c -> return (cs <> "{}" <> rest)
354+ -> cs <> " " <> rest
355+ | isSpace c -> cs <> "{}" <> rest
355356 | ctx == TextString
356− -> return (cs <> rest)
357− _ -> return (cs <> "{}" <> rest)
358− case x of
357+ -> cs <> rest
358+ _ -> cs <> "{}" <> rest
359+ in case x of
359360 '{' -> emits "\\{"
360361 '}' -> emits "\\}"
361362 '`' | ctx == CodeString -> emitcseq "\\textasciigrave"