git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: require that block tags are on separate lines

Text::Amuse already explicitly requires it anyway. Supporting block tags on the same line as contents makes it hard to combine closing tag parsers with indentation parsers. Being able to combine parsers is required for no-reparsing refactoring of Muse reader.

commit1dfda7e204a1304ac502a1045505430134516b7d authorAlexander Krotov <ilabdsf@gmail.com> dateSun 11 Feb 2018, 18:28 (9 years ago) parentcadcf62
1 file changed+26−19
test/Tests/Readers/Muse.hs+26−19
test/Tests/Readers/Muse.hs+26−19
@@ -259,10 +259,16 @@ tests =
259259 blockQuote (para "This is a quotation\nwith a continuation")
260260 , testGroup "Div"
261261 [ "Div without id" =:
262− "<div>Foo bar</div>" =?>
262+ T.unlines [ "<div>"
263+ , "Foo bar"
264+ , "</div>"
265+ ] =?>
263266 divWith nullAttr (para "Foo bar")
264267 , "Div with id" =:
265− "<div id=\"foo\">Foo bar</div>" =?>
268+ T.unlines [ "<div id=\"foo\">"
269+ , "Foo bar"
270+ , "</div>"
271+ ] =?>
266272 divWith ("foo", [], []) (para "Foo bar")
267273 ]
268274 , "Verse" =:
@@ -290,7 +296,12 @@ tests =
290296 , "\160\160\160is here"
291297 ]
292298 ]
293− , "Quote tag" =: "<quote>Hello, world</quote>" =?> blockQuote (para $ text "Hello, world")
299+ , "Quote tag" =:
300+ T.unlines [ "<quote>"
301+ , "Hello, world"
302+ , "</quote>"
303+ ]
304+ =?> blockQuote (para $ text "Hello, world")
294305 , "Verse tag" =:
295306 T.unlines [ "<verse>"
296307 , ""
@@ -431,8 +442,18 @@ tests =
431442 ] =?>
432443 para "<literal style=\"latex\">\n\\newpage\n</literal>"
433444 ]
434− , "Center" =: "<center>Hello, world</center>" =?> para (text "Hello, world")
435− , "Right" =: "<right>Hello, world</right>" =?> para (text "Hello, world")
445+ , "Center" =:
446+ T.unlines [ "<center>"
447+ , "Hello, world"
448+ , "</center>"
449+ ] =?>
450+ para (text "Hello, world")
451+ , "Right" =:
452+ T.unlines [ "<right>"
453+ , "Hello, world"
454+ , "</right>"
455+ ] =?>
456+ para (text "Hello, world")
436457 , testGroup "Comments"
437458 [ "Comment tag" =: "<comment>\nThis is a comment\n</comment>" =?> (mempty::Blocks)
438459 , "Line comment" =: "; Comment" =?> (mempty::Blocks)
@@ -1069,19 +1090,5 @@ tests =
10691090 , para "Second"
10701091 , para "Third"
10711092 ])
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− ])
10861093 ]
10871094 ]