aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-09 10:21:11 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-09 10:21:11 +0100
commit1e78aec88e5cd93b96ae0aaec47f7495d95a86e7 (patch)
treeb6cfc597a07eff4480265331dfe04198b31ca3ae /src/Text
parent11e57c4d18f3adc1742ed6b45642a2ac17ce68d8 (diff)
downloadpandoc-1e78aec88e5cd93b96ae0aaec47f7495d95a86e7.tar.gz
HTML writer: info message if 'lang' is unspecified.
Closes #3486.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index ab2713748..fdf62dd56 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -46,7 +46,7 @@ module Text.Pandoc.Writers.HTML (
import Control.Monad.State
import Data.Char (ord, toLower)
import Data.List (intersperse, isPrefixOf)
-import Data.Maybe (catMaybes, fromMaybe, isJust)
+import Data.Maybe (catMaybes, fromMaybe, isJust, isNothing)
import Data.Monoid ((<>))
import Data.String (fromString)
import Network.HTTP (urlEncode)
@@ -192,6 +192,9 @@ writeHtmlString' st opts d = do
case writerTemplate opts of
Nothing -> return $ renderHtml body
Just tpl -> do
+ -- warn if empty lang
+ when (isNothing (getField "lang" context :: Maybe String)) $
+ report NoLangSpecified
-- check for empty pagetitle
context' <-
case getField "pagetitle" context of