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.
This commit is contained in:
John MacFarlane 2017-06-20 14:22:19 +02:00
parent b26d3c4522
commit ea1724e35e
3 changed files with 14 additions and 8 deletions

View file

@ -217,8 +217,10 @@ blockToDocbook opts (Div (ident,_,_) bs) = do
(if null ident
then mempty
else selfClosingTag "anchor" [("id", ident)]) $$ contents
blockToDocbook _ (Header _ _ _) =
return empty -- should not occur after hierarchicalize
blockToDocbook _ h@(Header _ _ _) = do
-- should not occur after hierarchicalize, except inside lists/blockquotes
report $ BlockNotRendered h
return empty
blockToDocbook opts (Plain lst) = inlinesToDocbook opts lst
-- title beginning with fig: indicates that the image is a figure
blockToDocbook opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) = do

View file

@ -203,8 +203,10 @@ blockToJATS opts (Div (ident,_,kvs) bs) = do
[(k,v) | (k,v) <- kvs, k `elem` ["specific-use",
"content-type", "orientation", "position"]]
return $ inTags True "boxed-text" attr contents
blockToJATS _ (Header _ _ _) =
return empty -- should not occur after hierarchicalize
blockToJATS _ h@(Header _ _ _) = do
-- should not occur after hierarchicalize, except inside lists/blockquotes
report $ BlockNotRendered h
return empty
-- No Plain, everything needs to be in a block-level tag
blockToJATS opts (Plain lst) = blockToJATS opts (Para lst)
-- title beginning with fig: indicates that the image is a figure

View file

@ -159,11 +159,13 @@ blockToTEI opts (Div (ident,_,_) [Para lst]) = do
let attribs = [("id", ident) | not (null ident)]
inTags False "p" attribs <$> inlinesToTEI opts lst
blockToTEI opts (Div _ bs) = blocksToTEI opts $ map plainToPara bs
blockToTEI _ (Header _ _ _) = return empty
-- should not occur after hierarchicalize
blockToTEI _ h@(Header _ _ _) = do
-- should not occur after hierarchicalize, except inside lists/blockquotes
report $ BlockNotRendered h
return empty
-- For TEI simple, text must be within containing block element, so
-- we use plainToPara to ensure that Plain text ends up contained by
-- something.
-- we use treat as Para to ensure that Plain text ends up contained by
-- something:
blockToTEI opts (Plain lst) = blockToTEI opts $ Para lst
-- title beginning with fig: indicates that the image is a figure
--blockToTEI opts (Para [Image attr txt (src,'f':'i':'g':':':_)]) =