Expand month abbreviations.

This is done by bibtex2html, but not bib2bib.
This commit is contained in:
Justin Hsu 2016-02-18 23:46:23 -05:00
parent f1f98effa3
commit e9c58e4948
1 changed files with 17 additions and 0 deletions

View File

@ -50,6 +50,7 @@ bibEntryContext = Context $ \key _ item ->
Nothing -> empty Nothing -> empty
Just val -> case key of Just val -> case key of
"author" -> return $ StringField $ formatAuthors val "author" -> return $ StringField $ formatAuthors val
"month" -> return $ StringField $ expandMonth val
_ -> return $ StringField $ latexToHtml val _ -> return $ StringField $ latexToHtml val
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -99,6 +100,22 @@ formatAuthor = intercalate " "
. reverse . reverse
. (splitOn ",") . (splitOn ",")
--------------------------------------------------------------------------------
expandMonth :: String -> String
expandMonth mon = case mon of
"jan" -> "January"
"feb" -> "February"
"mar" -> "March"
"apr" -> "April"
"may" -> "May"
"jun" -> "June"
"jul" -> "July"
"aug" -> "August"
"sep" -> "September"
"oct" -> "October"
"nov" -> "November"
"dec" -> "December"
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Inefficient... -- Inefficient...
trimSpace :: String -> String trimSpace :: String -> String