diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-12 22:03:10 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-12 22:07:28 +0100 |
commit | 2f8f8f0da64388fa01d83fccf3cf1f2899c64269 (patch) | |
tree | 163b99c64a5ccffc7c419a5d7d686995959aea9f /src/Text/Pandoc/Readers/Org.hs | |
parent | c8b906256dccc7b0572c1707dee9b211c86e996d (diff) |
Issue warning for duplicate header identifiers.
As noted in the previous commit, an autogenerated identifier
may still coincide with an explicit identifier that is given
for a header later in the document, or with an identifier on
a div, span, link, or image. This commit adds a warning
in this case, so users can supply an explicit identifier.
* Added `DuplicateIdentifier` to LogMessage.
* Modified HTML, Org, MediaWiki readers so their custom
state type is an instance of HasLogMessages. This is necessary
for `registerHeader` to issue warnings.
See #1745.
Diffstat (limited to 'src/Text/Pandoc/Readers/Org.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index cc3ed6003..5e509178d 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -35,6 +35,7 @@ import Text.Pandoc.Class (PandocMonad) import Text.Pandoc.Definition import Text.Pandoc.Error import Text.Pandoc.Options +import Text.Pandoc.Parsing (reportLogMessages) import Control.Monad.Except (throwError) import Control.Monad.Reader (runReaderT) @@ -59,4 +60,5 @@ parseOrg :: PandocMonad m => OrgParser m Pandoc parseOrg = do blocks' <- blockList meta' <- meta + reportLogMessages return $ Pandoc meta' blocks' |