aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-02-04 19:36:05 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-02-04 19:36:05 -0800
commit800d5cdb07b6763686d1204ea81c358f8da82c73 (patch)
treee5d6dad149e0daa98c1957f7a03cfef9110b6728 /src/Text/Pandoc
parent80505bc49077b69c9413dc60b7e7b876a8ddd99b (diff)
downloadpandoc-800d5cdb07b6763686d1204ea81c358f8da82c73.tar.gz
LaTeX reader: support macron accents \=o.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index ebfc7414c..356462c98 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -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)