git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: support macron accents \=o.
commit800d5cdb07b6763686d1204ea81c358f8da82c73 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 4 Feb 2012, 19:36 (15 years ago) parent80505bc
1 file changed+14
src/Text/Pandoc/Readers/LaTeX.hs+14
src/Text/Pandoc/Readers/LaTeX.hs+14
@@ -343,6 +343,7 @@ inlineCommands = M.fromList
343343 , ("~", option (str "~") $ try $ tok >>= accent circ)
344344 , ("\"", option (str "\"") $ try $ tok >>= accent umlaut)
345345 , (".", option (str ".") $ try $ tok >>= accent dot)
346+ , ("=", option (str "=") $ try $ tok >>= accent macron)
346347 , ("i", lit "i")
347348 , ("\\", linebreak <$ optional (bracketed inline *> optional sp))
348349 , (",", pure mempty)
@@ -513,6 +514,19 @@ dot 'Z' = 'Ż'
513514dot 'z' = 'ż'
514515dot c = c
515516
517+macron :: Char -> Char
518+macron 'A' = 'Ā'
519+macron 'E' = 'Ē'
520+macron 'I' = 'Ī'
521+macron 'O' = 'Ō'
522+macron 'U' = 'Ū'
523+macron 'a' = 'ā'
524+macron 'e' = 'ē'
525+macron 'i' = 'ī'
526+macron 'o' = 'ō'
527+macron 'u' = 'ū'
528+macron c = c
529+
516530tok :: LP Inlines
517531tok = try $ grouped inline <|> inlineCommand <|> str <$> (count 1 $ inlineChar)
518532