git.iko.soy/typeable/pandoc
on master help sign in
DocBook writer: Remove non-existent admonitions
af9de92Jan Tojnar
src/Text/Pandoc/Writers/Docbook.hs+1−2
@@ -198,8 +198,7 @@ blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs))
198blockToDocbook opts (Div (ident,classes,_) bs) = do
198blockToDocbook opts (Div (ident,classes,_) bs) = do
199 version <- ask
199 version <- ask
200 let identAttribs = [(idName version, ident) | not (T.null ident)]
200 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"]
203 case classes of
202 case classes of
204 (l:_) | l `elem` admonitions -> do
203 (l:_) | l `elem` admonitions -> do
205 let (mTitleBs, bodyBs) =
204 let (mTitleBs, bodyBs) =
test/Tests/Writers/Docbook.hs+6−6
@@ -83,32 +83,32 @@ tests = [ testGroup "line blocks"
83 , "</warning>"
83 , "</warning>"
84 ]
84 ]
85 , "admonition-with-title" =:
85 , "admonition-with-title" =:
86− divWith ("foo", ["attention"], []) (
86+ divWith ("foo", ["note"], []) (
87 divWith ("foo", ["title"], [])
87 divWith ("foo", ["title"], [])
88 (plain (text "This is title")) <>
88 (plain (text "This is title")) <>
89 para "This is a test"
89 para "This is a test"
90 )
90 )
91 =?> unlines
91 =?> unlines
92− [ "<attention id=\"foo\">"
92+ [ "<note id=\"foo\">"
93 , " <title>This is title</title>"
93 , " <title>This is title</title>"
94 , " <para>"
94 , " <para>"
95 , " This is a test"
95 , " This is a test"
96 , " </para>"
96 , " </para>"
97− , "</attention>"
97+ , "</note>"
98 ]
98 ]
99 , "admonition-with-title-in-para" =:
99 , "admonition-with-title-in-para" =:
100− divWith ("foo", ["attention"], []) (
100+ divWith ("foo", ["note"], []) (
101 divWith ("foo", ["title"], [])
101 divWith ("foo", ["title"], [])
102 (para "This is title") <>
102 (para "This is title") <>
103 para "This is a test"
103 para "This is a test"
104 )
104 )
105 =?> unlines
105 =?> unlines
106− [ "<attention id=\"foo\">"
106+ [ "<note id=\"foo\">"
107 , " <title>This is title</title>"
107 , " <title>This is title</title>"
108 , " <para>"
108 , " <para>"
109 , " This is a test"
109 , " This is a test"
110 , " </para>"
110 , " </para>"
111− , "</attention>"
111+ , "</note>"
112 ]
112 ]
113 , "single-child" =:
113 , "single-child" =:
114 divWith ("foo", [], []) (para "This is a test")
114 divWith ("foo", [], []) (para "This is a test")