mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
LaTeX reader: support macron accents \=o.
This commit is contained in:
@@ -343,6 +343,7 @@ inlineCommands = M.fromList
|
||||
, ("~", option (str "~") $ try $ tok >>= accent circ)
|
||||
, ("\"", option (str "\"") $ try $ tok >>= accent umlaut)
|
||||
, (".", option (str ".") $ try $ tok >>= accent dot)
|
||||
, ("=", option (str "=") $ try $ tok >>= accent macron)
|
||||
, ("i", lit "i")
|
||||
, ("\\", linebreak <$ optional (bracketed inline *> optional sp))
|
||||
, (",", pure mempty)
|
||||
@@ -513,6 +514,19 @@ dot 'Z' = 'Ż'
|
||||
dot 'z' = 'ż'
|
||||
dot c = c
|
||||
|
||||
macron :: Char -> Char
|
||||
macron 'A' = 'Ā'
|
||||
macron 'E' = 'Ē'
|
||||
macron 'I' = 'Ī'
|
||||
macron 'O' = 'Ō'
|
||||
macron 'U' = 'Ū'
|
||||
macron 'a' = 'ā'
|
||||
macron 'e' = 'ē'
|
||||
macron 'i' = 'ī'
|
||||
macron 'o' = 'ō'
|
||||
macron 'u' = 'ū'
|
||||
macron c = c
|
||||
|
||||
tok :: LP Inlines
|
||||
tok = try $ grouped inline <|> inlineCommand <|> str <$> (count 1 $ inlineChar)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user