@@ -57,6 +57,7 @@ import Text.Pandoc.Parsing hiding (blankline, many, mathDisplay, mathInline,
5757import Text.Pandoc.Readers.LaTeX.Types (ExpansionPoint (..), Macro (..),
5858 ArgSpec (..), Tok (..), TokType (..))
5959import Text.Pandoc.Readers.LaTeX.Parsing
60+import Text.Pandoc.Readers.LaTeX.Accent (accentCommands)
6061import Text.Pandoc.Readers.LaTeX.Lang (polyglossiaLangToBCP47,
6162 babelLangToBCP47)
6263import Text.Pandoc.Readers.LaTeX.SIunitx
@@ -64,7 +65,6 @@ import Text.Pandoc.Shared
6465import qualified Text.Pandoc.Translations as Translations
6566import Text.Pandoc.Walk
6667import qualified Text.Pandoc.Builder as B
67−import qualified Data.Text.Normalize as Normalize
6868import Safe
6969
7070-- for debugging:
@@ -247,9 +247,6 @@ doxspace =
247247 startsWithLetter _ = False
248248
249249
250−lit :: Text -> LP m Inlines
251−lit = pure . str
252−
253250removeDoubleQuotes :: Text -> Text
254251removeDoubleQuotes t =
255252 Data.Maybe.fromMaybe t $ T.stripPrefix "\"" t >>= T.stripSuffix "\""
@@ -296,6 +293,9 @@ quoted' f starter ender = do
296293 cs -> cs)
297294 else lit startchs
298295
296+lit :: Text -> LP m Inlines
297+lit = pure . str
298+
299299enquote :: PandocMonad m => Bool -> Maybe Text -> LP m Inlines
300300enquote starred mblang = do
301301 skipopts
@@ -631,7 +631,10 @@ inlineEnvironments = M.fromList [
631631 ]
632632
633633inlineCommands :: PandocMonad m => M.Map Text (LP m Inlines)
634−inlineCommands = M.union inlineLanguageCommands $ M.fromList
634+inlineCommands =
635+ M.union inlineLanguageCommands $
636+ M.union (accentCommands tok) $
637+ M.fromList
635638 [ ("emph", extractSpaces emph <$> tok)
636639 , ("textit", extractSpaces emph <$> tok)
637640 , ("textsl", extractSpaces emph <$> tok)
@@ -703,48 +706,6 @@ inlineCommands = M.union inlineLanguageCommands $ M.fromList
703706 , ("MakeTextLowercase", makeLowercase <$> tok)
704707 , ("lowercase", makeLowercase <$> tok)
705708 , ("/", pure mempty) -- italic correction
706− , ("aa", lit "å")
707− , ("AA", lit "Å")
708− , ("ss", lit "ß")
709− , ("o", lit "ø")
710− , ("O", lit "Ø")
711− , ("L", lit "Ł")
712− , ("l", lit "ł")
713− , ("ae", lit "æ")
714− , ("AE", lit "Æ")
715− , ("oe", lit "œ")
716− , ("OE", lit "Œ")
717− , ("pounds", lit "£")
718− , ("euro", lit "€")
719− , ("copyright", lit "©")
720− , ("textasciicircum", lit "^")
721− , ("textasciitilde", lit "~")
722− , ("H", accent '\779' Nothing) -- hungarumlaut
723− , ("`", accent '\768' (Just '`')) -- grave
724− , ("'", accent '\769' (Just '\'')) -- acute
725− , ("^", accent '\770' (Just '^')) -- circ
726− , ("~", accent '\771' (Just '~')) -- tilde
727− , ("\"", accent '\776' Nothing) -- umlaut
728− , (".", accent '\775' Nothing) -- dot
729− , ("=", accent '\772' Nothing) -- macron
730− , ("|", accent '\781' Nothing) -- vertical line above
731− , ("b", accent '\817' Nothing) -- macron below
732− , ("c", accent '\807' Nothing) -- cedilla
733− , ("G", accent '\783' Nothing) -- doublegrave
734− , ("h", accent '\777' Nothing) -- hookabove
735− , ("d", accent '\803' Nothing) -- dotbelow
736− , ("f", accent '\785' Nothing) -- inverted breve
737− , ("r", accent '\778' Nothing) -- ringabove
738− , ("t", accent '\865' Nothing) -- double inverted breve
739− , ("U", accent '\782' Nothing) -- double vertical line above
740− , ("v", accent '\780' Nothing) -- hacek
741− , ("u", accent '\774' Nothing) -- breve
742− , ("k", accent '\808' Nothing) -- ogonek
743− , ("textogonekcentered", accent '\808' Nothing) -- ogonek
744− , ("i", lit "ı") -- dotless i
745− , ("j", lit "ȷ") -- dotless j
746− , ("newtie", accent '\785' Nothing) -- inverted breve
747− , ("textcircled", accent '\8413' Nothing) -- combining circle
748709 , ("\\", linebreak <$ (do inTableCell <- sInTableCell <$> getState
749710 guard $ not inTableCell
750711 optional opt
@@ -960,19 +921,6 @@ inlineCommands = M.union inlineLanguageCommands $ M.fromList
960921 , ("hyphen", pure (str "-"))
961922 ]
962923
963−accent :: PandocMonad m => Char -> Maybe Char -> LP m Inlines
964−accent combiningAccent fallBack = try $ do
965− ils <- tok
966− case toList ils of
967− (Str (T.uncons -> Just (x, xs)) : ys) -> return $ fromList $
968− -- try to normalize to the combined character:
969− Str (Normalize.normalize Normalize.NFC
970− (T.pack [x, combiningAccent]) <> xs) : ys
971− [Space] -> return $ str $ T.singleton $ fromMaybe combiningAccent fallBack
972− [] -> return $ str $ T.singleton $ fromMaybe combiningAccent fallBack
973− _ -> return ils
974−
975−
976924lettrine :: PandocMonad m => LP m Inlines
977925lettrine = do
978926 optional opt