@@ -20,6 +20,7 @@ import Tests.Helpers
2020import Text.Pandoc
2121import Text.Pandoc.Arbitrary ()
2222import Text.Pandoc.Builder
23+ import Data.List (intersperse )
2324
2425dokuwiki :: Text -> Pandoc
2526dokuwiki = purely $ readDokuWiki def{ readerStandalone = True }
@@ -144,31 +145,31 @@ tests = [ testGroup "inlines"
144145 , testGroup " Images"
145146 [ " Image" =:
146147 " {{image.jpg}}" =?>
147- para (image " image.jpg" " " (str " image.jpg" ))
148+ simpleFigure [ Str " image.jpg" ] " image.jpg" " "
148149 , " Image with caption" =:
149150 " {{image.png|This is the caption}}" =?>
150- para (image " image.png " " " " This is the caption" )
151+ simpleFigure (intersperse Space $ Str <$> T. words " This is the caption" ) " image.png " " "
151152 , " Image with } in caption" =:
152- " {{image.png|There is an } in the caption}}" =?>
153- para (image " image.png " " " " There is an } in the caption" )
153+ " {{image.png|There is a } in the caption}}" =?>
154+ simpleFigure (intersperse Space $ Str <$> T. words " There is a } in the caption" ) " image.png " " "
154155 , " Wiki namespace starting with dot" =:
155156 " {{.wiki:image.jpg}}" =?>
156- para (image " wiki/ image.jpg" " " (str " image.jpg" ))
157+ simpleFigure [ Str " image.jpg" ] " wiki/ image.jpg" " "
157158 , " Left aligned image" =:
158159 " {{wiki:dokuwiki-128.png }}" =?>
159- para (imageWith ( " " , [" align-left" ], [] ) " /wiki/ dokuwiki-128.png" " " (str " dokuwiki-128.png" ))
160+ simpleFigureWith ( " " , [" align-left" ], [] ) [ Str " dokuwiki-128.png" ] " /wiki/ dokuwiki-128.png" " "
160161 , " Right aligned image" =:
161162 " {{ wiki:dokuwiki-128.png}}" =?>
162- para (imageWith ( " " , [" align-right" ], [] ) " /wiki/ dokuwiki-128.png" " " (str " dokuwiki-128.png" ))
163+ simpleFigureWith ( " " , [" align-right" ], [] ) [ Str " dokuwiki-128.png" ] " /wiki/ dokuwiki-128.png" " "
163164 , " Centered image" =:
164165 " {{ wiki:dokuwiki-128.png }}" =?>
165- para (imageWith ( " " , [" align-center" ], [] ) " /wiki/ dokuwiki-128.png" " " (str " dokuwiki-128.png" ))
166+ simpleFigureWith ( " " , [" align-center" ], [] ) [ Str " dokuwiki-128.png" ] " /wiki/ dokuwiki-128.png" " "
166167 , " Image with width" =:
167168 " {{wiki:dokuwiki-128.png?50}}" =?>
168- para (imageWith ( " " , [] , [(" width" , " 50" )]) " /wiki/ dokuwiki-128.png" " " (str " dokuwiki-128.png" ))
169+ simpleFigureWith ( " " , [] , [(" width" ," 50" )]) [ Str " dokuwiki-128.png" ] " /wiki/ dokuwiki-128.png" " "
169170 , " Image with width and height" =:
170171 " {{wiki:dokuwiki-128.png?nocache&50x100}}" =?>
171- para (imageWith ( " " , [] , [(" width" , " 50" ), (" height" , " 100" )]) " /wiki/ dokuwiki-128.png" " " (str " dokuwiki-128.png" ))
172+ simpleFigureWith ( " " , [] , [(" width" ," 50" ), (" height" , " 100" )]) [ Str " dokuwiki-128.png" ] " /wiki/ dokuwiki-128.png" " "
172173 , " Linkonly" =:
173174 " {{wiki:dokuwiki-128.png?linkonly}}" =?>
174175 para (link " /wiki/dokuwiki-128.png" " " (str " dokuwiki-128.png" ))
0 commit comments