From 1e78aec88e5cd93b96ae0aaec47f7495d95a86e7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 9 Mar 2017 10:21:11 +0100 Subject: HTML writer: info message if 'lang' is unspecified. Closes #3486. --- src/Text/Pandoc/Writers/HTML.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc') 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 -- cgit v1.2.3