git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: require that block tags are on separate lines
1dfda7eAlexander Krotov
test/Tests/Readers/Muse.hs+26−19
@@ -259,10 +259,16 @@ tests =
259 blockQuote (para "This is a quotation\nwith a continuation")
259 blockQuote (para "This is a quotation\nwith a continuation")
260 , testGroup "Div"
260 , testGroup "Div"
261 [ "Div without id" =:
261 [ "Div without id" =:
262+ T.unlines [ "<div>"
262− "<div>Foo bar</div>" =?>
263+ , "Foo bar"
264+ , "</div>"
265+ ] =?>
263 divWith nullAttr (para "Foo bar")
266 divWith nullAttr (para "Foo bar")
264 , "Div with id" =:
267 , "Div with id" =:
268+ T.unlines [ "<div id=\"foo\">"
265− "<div id=\"foo\">Foo bar</div>" =?>
269+ , "Foo bar"
270+ , "</div>"
271+ ] =?>
266 divWith ("foo", [], []) (para "Foo bar")
272 divWith ("foo", [], []) (para "Foo bar")
267 ]
273 ]
268 , "Verse" =:
274 , "Verse" =:
@@ -290,7 +296,12 @@ tests =
290 , "\160\160\160is here"
296 , "\160\160\160is here"
291 ]
297 ]
292 ]
298 ]
299+ , "Quote tag" =:
300+ T.unlines [ "<quote>"
301+ , "Hello, world"
302+ , "</quote>"
303+ ]
293− , "Quote tag" =: "<quote>Hello, world</quote>" =?> blockQuote (para $ text "Hello, world")
304+ =?> blockQuote (para $ text "Hello, world")
294 , "Verse tag" =:
305 , "Verse tag" =:
295 T.unlines [ "<verse>"
306 T.unlines [ "<verse>"
296 , ""
307 , ""
@@ -431,8 +442,18 @@ tests =
431 ] =?>
442 ] =?>
432 para "<literal style=\"latex\">\n\\newpage\n</literal>"
443 para "<literal style=\"latex\">\n\\newpage\n</literal>"
433 ]
444 ]
445+ , "Center" =:
446+ T.unlines [ "<center>"
447+ , "Hello, world"
448+ , "</center>"
449+ ] =?>
434− , "Center" =: "<center>Hello, world</center>" =?> para (text "Hello, world")
450+ para (text "Hello, world")
451+ , "Right" =:
452+ T.unlines [ "<right>"
453+ , "Hello, world"
454+ , "</right>"
455+ ] =?>
435− , "Right" =: "<right>Hello, world</right>" =?> para (text "Hello, world")
456+ para (text "Hello, world")
436 , testGroup "Comments"
457 , testGroup "Comments"
437 [ "Comment tag" =: "<comment>\nThis is a comment\n</comment>" =?> (mempty::Blocks)
458 [ "Comment tag" =: "<comment>\nThis is a comment\n</comment>" =?> (mempty::Blocks)
438 , "Line comment" =: "; Comment" =?> (mempty::Blocks)
459 , "Line comment" =: "; Comment" =?> (mempty::Blocks)
@@ -1069,19 +1090,5 @@ tests =
1069 , para "Second"
1090 , para "Second"
1070 , para "Third"
1091 , para "Third"
1071 ])
1092 ])
1072− -- Amusewiki requires block tags to be on separate lines,
1073− -- but Emacs Muse allows them to be on the same line as contents.
1074− , "List inside an inline tag" =:
1075− T.unlines
1076− [ "<quote> 1. First"
1077− , ""
1078− , " 2. Second"
1079− , ""
1080− , " 3. Third</quote>"
1081− ] =?>
1082− blockQuote (orderedListWith (1, Decimal, Period) [ para "First"
1083− , para "Second"
1084− , para "Third"
1085− ])
1086 ]
1093 ]
1087 ]
1094 ]