adding support for breve accents via \u{} while reading LaTeX
This commit is contained in:
parent
5af0de23cc
commit
c45bd6d468
1 changed files with 16 additions and 0 deletions
|
@ -416,6 +416,7 @@ inlineCommands = M.fromList $
|
|||
, ("=", option (str "=") $ try $ tok >>= accent macron)
|
||||
, ("c", option (str "c") $ try $ tok >>= accent cedilla)
|
||||
, ("v", option (str "v") $ try $ tok >>= accent hacek)
|
||||
, ("u", option (str "u") $ try $ tok >>= accent breve)
|
||||
, ("i", lit "i")
|
||||
, ("\\", linebreak <$ (optional (bracketed inline) *> optional sp))
|
||||
, (",", pure mempty)
|
||||
|
@ -708,6 +709,21 @@ hacek 'Z' = 'Ž'
|
|||
hacek 'z' = 'ž'
|
||||
hacek c = c
|
||||
|
||||
breve :: Char -> Char
|
||||
breve 'A' = 'Ă'
|
||||
breve 'a' = 'ă'
|
||||
breve 'E' = 'Ĕ'
|
||||
breve 'e' = 'ĕ'
|
||||
breve 'G' = 'Ğ'
|
||||
breve 'g' = 'ğ'
|
||||
breve 'I' = 'Ĭ'
|
||||
breve 'i' = 'ĭ'
|
||||
breve 'O' = 'Ŏ'
|
||||
breve 'o' = 'ŏ'
|
||||
breve 'U' = 'Ŭ'
|
||||
breve 'u' = 'ŭ'
|
||||
breve c = c
|
||||
|
||||
tok :: LP Inlines
|
||||
tok = try $ grouped inline <|> inlineCommand <|> str <$> (count 1 $ inlineChar)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue