git.iko.soy/typeable/pandoc
on master help sign in
Docbook, JATS, TEI writers: print INFO message when omitting interior header.

This only applies to section headers inside list items, e.g., which were otherwise silently omitted. See #3750.

commitea1724e35e5ac008ef1293cb7b2b49595392c38e authorJohn MacFarlane <jgm@berkeley.edu> dateTue 20 Jun 2017, 14:22 (9 years ago) parentb26d3c4
3 files changed+14−8
src/Text/Pandoc/Writers/Docbook.hs+4−2 src/Text/Pandoc/Writers/JATS.hs+4−2 src/Text/Pandoc/Writers/TEI.hs+6−4
src/Text/Pandoc/Writers/Docbook.hs+4−2
@@ -217,8 +217,10 @@ blockToDocbook opts (Div (ident,_,_) bs) = do
217217 (if null ident
218218 then mempty
219219 else selfClosingTag "anchor" [("id", ident)]) $$ contents
220−blockToDocbook _ (Header _ _ _) =
221− return empty -- should not occur after hierarchicalize
220+blockToDocbook _ h@(Header _ _ _) = do
221+ -- should not occur after hierarchicalize, except inside lists/blockquotes
222+ report $ BlockNotRendered h
223+ return empty
222224blockToDocbook opts (Plain lst) = inlinesToDocbook opts lst
223225-- title beginning with fig: indicates that the image is a figure
224226blockToDocbook opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) = do
src/Text/Pandoc/Writers/JATS.hs+4−2
@@ -203,8 +203,10 @@ blockToJATS opts (Div (ident,_,kvs) bs) = do
203203 [(k,v) | (k,v) <- kvs, k `elem` ["specific-use",
204204 "content-type", "orientation", "position"]]
205205 return $ inTags True "boxed-text" attr contents
206−blockToJATS _ (Header _ _ _) =
207− return empty -- should not occur after hierarchicalize
206+blockToJATS _ h@(Header _ _ _) = do
207+ -- should not occur after hierarchicalize, except inside lists/blockquotes
208+ report $ BlockNotRendered h
209+ return empty
208210-- No Plain, everything needs to be in a block-level tag
209211blockToJATS opts (Plain lst) = blockToJATS opts (Para lst)
210212-- title beginning with fig: indicates that the image is a figure
src/Text/Pandoc/Writers/TEI.hs+6−4
@@ -159,11 +159,13 @@ blockToTEI opts (Div (ident,_,_) [Para lst]) = do
159159 let attribs = [("id", ident) | not (null ident)]
160160 inTags False "p" attribs <$> inlinesToTEI opts lst
161161blockToTEI opts (Div _ bs) = blocksToTEI opts $ map plainToPara bs
162−blockToTEI _ (Header _ _ _) = return empty
163−-- should not occur after hierarchicalize
162+blockToTEI _ h@(Header _ _ _) = do
163+ -- should not occur after hierarchicalize, except inside lists/blockquotes
164+ report $ BlockNotRendered h
165+ return empty
164166-- For TEI simple, text must be within containing block element, so
165−-- we use plainToPara to ensure that Plain text ends up contained by
166−-- something.
167+-- we use treat as Para to ensure that Plain text ends up contained by
168+-- something:
167169blockToTEI opts (Plain lst) = blockToTEI opts $ Para lst
168170-- title beginning with fig: indicates that the image is a figure
169171--blockToTEI opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) =