git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: remove multiple descriptions during round-trip tests
98f0e20Alexander Krotov
test/Tests/Readers/Muse.hs+6
@@ -28,9 +28,15 @@ spcSep :: [Inlines] -> Inlines
28spcSep = mconcat . intersperse space
28spcSep = mconcat . intersperse space
29
29
30-- Tables don't round-trip yet
30-- Tables don't round-trip yet
31+-- Definition lists with multiple descriptions are supported by writer, but not reader yet
32+
33+singleDescription :: ([Inline], [[Block]]) -> ([Inline], [[Block]])
34+singleDescription (a, x:_) = (a, [x])
35+singleDescription x = x
31
36
32makeRoundTrip :: Block -> Block
37makeRoundTrip :: Block -> Block
33makeRoundTrip Table{} = Para [Str "table was here"]
38makeRoundTrip Table{} = Para [Str "table was here"]
39+makeRoundTrip (DefinitionList items) = DefinitionList $ map singleDescription items
34makeRoundTrip x = x
40makeRoundTrip x = x
35
41
36-- Demand that any AST produced by Muse reader and written by Muse writer can be read back exactly the same way.
42-- Demand that any AST produced by Muse reader and written by Muse writer can be read back exactly the same way.