@@ -24,8 +24,9 @@ import Data.Text (Text)
2424import qualified Data.Text as T
2525import Text.HTML.TagSoup.Entity (lookupEntity)
2626import Text.Pandoc.Builder
27−import Text.Pandoc.Class (PandocMonad)
27+import Text.Pandoc.Class (PandocMonad, report)
2828import Text.Pandoc.Options
29+import Text.Pandoc.Logging (LogMessage(..))
2930import Text.Pandoc.Shared (crFilter, safeRead)
3031import Text.TeXMath (readMathML, writeTeX)
3132import Text.XML.Light
@@ -690,8 +691,8 @@ parseBlock (Text (CData _ s _)) = if all isSpace s
690691parseBlock (CRef x) = return $ plain $ str $ map toUpper x
691692parseBlock (Elem e) =
692693 case qName (elName e) of
693− "toc" -> return mempty -- skip TOC, since in pandoc it's autogenerated
694− "index" -> return mempty -- skip index, since page numbers meaningless
694+ "toc" -> skip -- skip TOC, since in pandoc it's autogenerated
695+ "index" -> skip -- skip index, since page numbers meaningless
695696 "para" -> parseMixed para (elContent e)
696697 "formalpara" -> do
697698 tit <- case filterChild (named "title") e of
@@ -703,9 +704,9 @@ parseBlock (Elem e) =
703704 "ackno" -> parseMixed para (elContent e)
704705 "epigraph" -> parseBlockquote
705706 "blockquote" -> parseBlockquote
706− "attribution" -> return mempty
707− "titleabbrev" -> return mempty
708− "authorinitials" -> return mempty
707+ "attribution" -> skip
708+ "titleabbrev" -> skip
709+ "authorinitials" -> skip
709710 "bibliography" -> sect 0
710711 "bibliodiv" -> sect 1
711712 "biblioentry" -> parseMixed para (elContent e)
@@ -745,9 +746,9 @@ parseBlock (Elem e) =
745746 <$> getBlocks e
746747 "warning" -> blockQuote . (para (strong $ str "Warning") <>)
747748 <$> getBlocks e
748− "area" -> return mempty
749− "areaset" -> return mempty
750− "areaspec" -> return mempty
749+ "area" -> skip
750+ "areaset" -> skip
751+ "areaspec" -> skip
751752 "qandadiv" -> gets dbSectionLevel >>= sect . (+1)
752753 "question" -> addToStart (strong (str "Q:") <> str " ") <$> getBlocks e
753754 "answer" -> addToStart (strong (str "A:") <> str " ") <$> getBlocks e
@@ -770,22 +771,22 @@ parseBlock (Elem e) =
770771 "variablelist" -> definitionList <$> deflistitems
771772 "figure" -> getFigure e
772773 "mediaobject" -> para <$> getMediaobject e
773− "caption" -> return mempty
774+ "caption" -> skip
774775 "info" -> addMetadataFromElement e
775776 "articleinfo" -> addMetadataFromElement e
776− "sectioninfo" -> return mempty -- keywords & other metadata
777− "refsectioninfo" -> return mempty -- keywords & other metadata
778− "refsect1info" -> return mempty -- keywords & other metadata
779− "refsect2info" -> return mempty -- keywords & other metadata
780− "refsect3info" -> return mempty -- keywords & other metadata
781− "sect1info" -> return mempty -- keywords & other metadata
782− "sect2info" -> return mempty -- keywords & other metadata
783− "sect3info" -> return mempty -- keywords & other metadata
784− "sect4info" -> return mempty -- keywords & other metadata
785− "sect5info" -> return mempty -- keywords & other metadata
786− "chapterinfo" -> return mempty -- keywords & other metadata
787− "glossaryinfo" -> return mempty -- keywords & other metadata
788− "appendixinfo" -> return mempty -- keywords & other metadata
777+ "sectioninfo" -> skip -- keywords & other metadata
778+ "refsectioninfo" -> skip -- keywords & other metadata
779+ "refsect1info" -> skip -- keywords & other metadata
780+ "refsect2info" -> skip -- keywords & other metadata
781+ "refsect3info" -> skip -- keywords & other metadata
782+ "sect1info" -> skip -- keywords & other metadata
783+ "sect2info" -> skip -- keywords & other metadata
784+ "sect3info" -> skip -- keywords & other metadata
785+ "sect4info" -> skip -- keywords & other metadata
786+ "sect5info" -> skip -- keywords & other metadata
787+ "chapterinfo" -> skip -- keywords & other metadata
788+ "glossaryinfo" -> skip -- keywords & other metadata
789+ "appendixinfo" -> skip -- keywords & other metadata
789790 "bookinfo" -> addMetadataFromElement e
790791 "article" -> modify (\st -> st{ dbBook = False }) >>
791792 addMetadataFromElement e >> getBlocks e
@@ -802,8 +803,12 @@ parseBlock (Elem e) =
802803 "?xml" -> return mempty
803804 "title" -> return mempty -- handled in parent element
804805 "subtitle" -> return mempty -- handled in parent element
805− _ -> getBlocks e
806− where parseMixed container conts = do
806+ _ -> skip >> getBlocks e
807+ where skip = do
808+ lift $ report $ IgnoredElement $ qName (elName e)
809+ return mempty
810+
811+ parseMixed container conts = do
807812 let (ils,rest) = break isBlockElement conts
808813 ils' <- (trimInlines . mconcat) <$> mapM parseInline ils
809814 let p = if ils' == mempty then mempty else container ils'
@@ -1000,13 +1005,17 @@ parseInline (Elem e) =
10001005 "footnote" -> (note . mconcat) <$>
10011006 mapM parseBlock (elContent e)
10021007 "title" -> return mempty
1003− "affiliation" -> return mempty
1008+ "affiliation" -> skip
10041009 -- Note: this isn't a real docbook tag; it's what we convert
10051010 -- <?asciidor-br?> to in handleInstructions, above. A kludge to
10061011 -- work around xml-light's inability to parse an instruction.
10071012 "br" -> return linebreak
1008− _ -> innerInlines
1009− where innerInlines = (trimInlines . mconcat) <$>
1013+ _ -> skip >> innerInlines
1014+ where skip = do
1015+ lift $ report $ IgnoredElement $ qName (elName e)
1016+ return mempty
1017+
1018+ innerInlines = (trimInlines . mconcat) <$>
10101019 mapM parseInline (elContent e)
10111020 codeWithLang = do
10121021 let classes' = case attrValue "language" e of