@@ -162,6 +162,7 @@ module Text.Pandoc.Parsing ( anyLine,
162 setSourceColumn,
162 setSourceColumn,
163 setSourceLine,
163 setSourceLine,
@@ -1245,3 +1246,10 @@ applyMacros' target = do
1245 then do macros <- extractMacros <$> getState
1246 then do macros <- extractMacros <$> getState
1246 return $ applyMacros macros target
1247 return $ applyMacros macros target
1247 else return target
1248 else return target
1250+-- | Append a warning to the log.
1251+addWarning :: Maybe SourcePos -> String -> Parser [Char] ParserState ()
1252+addWarning mbpos msg =
1253+ updateState $ \st -> st{
1254+ stateWarnings = (msg ++ maybe "" (\pos -> " " ++ show pos) mbpos) :