DocBook writer: Remove non-existent admonitions

attention, error and hint are actually just reStructuredText specific.
danger was too until introduced in DocBook 5.2: https://github.com/docbook/docbook/issues/55
This commit is contained in:
Jan Tojnar 2021-06-05 14:16:44 +02:00 committed by John MacFarlane
parent b6c04383e4
commit af9de925de
2 changed files with 7 additions and 8 deletions

View file

@ -198,8 +198,7 @@ blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs))
blockToDocbook opts (Div (ident,classes,_) bs) = do
version <- ask
let identAttribs = [(idName version, ident) | not (T.null ident)]
admonitions = ["attention","caution","danger","error","hint",
"important","note","tip","warning"]
admonitions = ["caution","danger","important","note","tip","warning"]
case classes of
(l:_) | l `elem` admonitions -> do
let (mTitleBs, bodyBs) =

View file

@ -83,32 +83,32 @@ tests = [ testGroup "line blocks"
, "</warning>"
]
, "admonition-with-title" =:
divWith ("foo", ["attention"], []) (
divWith ("foo", ["note"], []) (
divWith ("foo", ["title"], [])
(plain (text "This is title")) <>
para "This is a test"
)
=?> unlines
[ "<attention id=\"foo\">"
[ "<note id=\"foo\">"
, " <title>This is title</title>"
, " <para>"
, " This is a test"
, " </para>"
, "</attention>"
, "</note>"
]
, "admonition-with-title-in-para" =:
divWith ("foo", ["attention"], []) (
divWith ("foo", ["note"], []) (
divWith ("foo", ["title"], [])
(para "This is title") <>
para "This is a test"
)
=?> unlines
[ "<attention id=\"foo\">"
[ "<note id=\"foo\">"
, " <title>This is title</title>"
, " <para>"
, " This is a test"
, " </para>"
, "</attention>"
, "</note>"
]
, "single-child" =:
divWith ("foo", [], []) (para "This is a test")