Skip to content

Commit e0f7c1b

Browse files
committed
Use SimpleFigure in Docbook writer.
1 parent f83f50c commit e0f7c1b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Text/Pandoc/Writers/Docbook.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE OverloadedStrings #-}
22
{-# LANGUAGE PatternGuards #-}
3-
{-# LANGUAGE ViewPatterns #-}
43
{- |
54
Module : Text.Pandoc.Writers.Docbook
65
Copyright : Copyright (C) 2006-2021 John MacFarlane
@@ -188,7 +187,7 @@ blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs))
188187
-- standalone documents will include them in the template.
189188
then [("xmlns", "http://docbook.org/ns/docbook"),("xmlns:xlink", "http://www.w3.org/1999/xlink")]
190189
else []
191-
190+
192191
-- Populate miscAttr with Header.Attr.attributes, filtering out non-valid DocBook section attributes, id, and xml:id
193192
miscAttr = filter (isSectionAttr version) attrs
194193
attribs = nsAttr <> idAttr <> miscAttr
@@ -233,7 +232,7 @@ blockToDocbook _ h@Header{} = do
233232
return empty
234233
blockToDocbook opts (Plain lst) = inlinesToDocbook opts lst
235234
-- title beginning with fig: indicates that the image is a figure
236-
blockToDocbook opts (Para [Image attr txt (src,T.stripPrefix "fig:" -> Just _)]) = do
235+
blockToDocbook opts (SimpleFigure attr txt (src, _)) = do
237236
alt <- inlinesToDocbook opts txt
238237
let capt = if null txt
239238
then empty

0 commit comments

Comments
 (0)