Skip to content

Commit 9ea80bc

Browse files
committed
Rename simpleFigure to simpleFigureWith.
1 parent 6c2e56f commit 9ea80bc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Text/Pandoc/Builder.hs

+6-2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ module Text.Pandoc.Builder ( module Text.Pandoc.Definition
170170
, caption
171171
, simpleCaption
172172
, emptyCaption
173+
, simpleFigureWith
173174
, simpleFigure
174175
, divWith
175176
-- * Table processing
@@ -567,10 +568,13 @@ simpleCaption = caption Nothing
567568
emptyCaption :: Caption
568569
emptyCaption = simpleCaption mempty
569570

570-
simpleFigure :: Attr -> [Inline] -> Text -> Text -> Blocks
571-
simpleFigure attr figureCaption url title =
571+
simpleFigureWith :: Attr -> [Inline] -> Text -> Text -> Blocks
572+
simpleFigureWith attr figureCaption url title =
572573
singleton $ Para [Image attr figureCaption (url, "fig:" <> title)]
573574

575+
simpleFigure :: [Inline] -> Text -> Text -> Blocks
576+
simpleFigure = simpleFigureWith nullAttr
577+
574578
divWith :: Attr -> Blocks -> Blocks
575579
divWith attr = singleton . Div attr . toList
576580

test/test-pandoc-types.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Text.Pandoc.Definition
55
import Text.Pandoc.Walk
66
import Text.Pandoc.Builder (singleton, plain, text, simpleTable, table, emptyCell,
77
normalizeTableHead, normalizeTableBody, normalizeTableFoot,
8-
emptyCaption, simpleFigure)
8+
emptyCaption, simpleFigureWith)
99
import qualified Text.Pandoc.Builder as Builder
1010
import Data.Generics
1111
import Data.List (tails)
@@ -645,7 +645,7 @@ t_tableNormExample = testCase "table normalization example" assertion
645645

646646
p_figureRepresentation :: Property
647647
p_figureRepresentation = forAll (arbitrary :: Gen [Inline]) (\figureCaption ->
648-
simpleFigure ("", [], []) figureCaption "url" "title" == Builder.fromList
648+
simpleFigureWith ("", [], []) figureCaption "url" "title" == Builder.fromList
649649
[Para [Image ("", [], []) figureCaption ("url", "fig:title") ]]
650650
)
651651

0 commit comments

Comments
 (0)