git.iko.soy/typeable/pandoc
on master help sign in
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

commitaf9de925de4a441f4c45a977363f9a56589f57bc authorJan Tojnar <jtojnar@gmail.com> dateSat 5 Jun 2021, 14:16 (5 years ago) parentb6c0438
2 files changed+7−8
src/Text/Pandoc/Writers/Docbook.hs+1−2 test/Tests/Writers/Docbook.hs+6−6
src/Text/Pandoc/Writers/Docbook.hs+1−2
@@ -198,8 +198,7 @@ blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs))
198198blockToDocbook opts (Div (ident,classes,_) bs) = do
199199 version <- ask
200200 let identAttribs = [(idName version, ident) | not (T.null ident)]
201− admonitions = ["attention","caution","danger","error","hint",
202− "important","note","tip","warning"]
201+ admonitions = ["caution","danger","important","note","tip","warning"]
203202 case classes of
204203 (l:_) | l `elem` admonitions -> do
205204 let (mTitleBs, bodyBs) =
test/Tests/Writers/Docbook.hs+6−6
@@ -83,32 +83,32 @@ tests = [ testGroup "line blocks"
8383 , "</warning>"
8484 ]
8585 , "admonition-with-title" =:
86− divWith ("foo", ["attention"], []) (
86+ divWith ("foo", ["note"], []) (
8787 divWith ("foo", ["title"], [])
8888 (plain (text "This is title")) <>
8989 para "This is a test"
9090 )
9191 =?> unlines
92− [ "<attention id=\"foo\">"
92+ [ "<note id=\"foo\">"
9393 , " <title>This is title</title>"
9494 , " <para>"
9595 , " This is a test"
9696 , " </para>"
97− , "</attention>"
97+ , "</note>"
9898 ]
9999 , "admonition-with-title-in-para" =:
100− divWith ("foo", ["attention"], []) (
100+ divWith ("foo", ["note"], []) (
101101 divWith ("foo", ["title"], [])
102102 (para "This is title") <>
103103 para "This is a test"
104104 )
105105 =?> unlines
106− [ "<attention id=\"foo\">"
106+ [ "<note id=\"foo\">"
107107 , " <title>This is title</title>"
108108 , " <para>"
109109 , " This is a test"
110110 , " </para>"
111− , "</attention>"
111+ , "</note>"
112112 ]
113113 , "single-child" =:
114114 divWith ("foo", [], []) (para "This is a test")