diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-25 12:45:42 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-25 12:46:26 +0200 |
commit | a02f08c9fc608727da0ac3b65b39f627e8bb2033 (patch) | |
tree | 1356bea3847d5c41e42eb620dd39d50693c7e1b9 | |
parent | 0c993a6c7b73bfd10c795f45abfed32772790999 (diff) | |
download | pandoc-a02f08c9fc608727da0ac3b65b39f627e8bb2033.tar.gz |
Added InvalidLang to LogMessage.
-rw-r--r-- | src/Text/Pandoc/Logging.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index 4090243ea..ad0fcdd2d 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -90,6 +90,7 @@ data LogMessage = | Extracting String | NoTitleElement String | NoLangSpecified + | InvalidLang String | CouldNotHighlight String | MissingCharacter String deriving (Show, Eq, Data, Ord, Typeable, Generic) @@ -178,6 +179,8 @@ instance ToJSON LogMessage where NoTitleElement fallback -> ["fallback" .= Text.pack fallback] NoLangSpecified -> [] + InvalidLang s -> + ["lang" .= Text.pack s] CouldNotHighlight msg -> ["message" .= Text.pack msg] MissingCharacter msg -> @@ -254,6 +257,9 @@ showLogMessage msg = NoLangSpecified -> "No value for 'lang' was specified in the metadata.\n" ++ "It is recommended that lang be specified for this format." + InvalidLang s -> + "Invalid 'lang' value '" ++ s ++ "'.\n" ++ + "Use ISO 8601 format like 'en-US'." CouldNotHighlight m -> "Could not highlight code block:\n" ++ m MissingCharacter m -> @@ -285,5 +291,6 @@ messageVerbosity msg = Extracting{} -> INFO NoTitleElement{} -> WARNING NoLangSpecified -> INFO + InvalidLang{} -> WARNING CouldNotHighlight{} -> WARNING MissingCharacter{} -> WARNING |