@@ -421,6 +421,58 @@ tests =
421421 ] =?>
422422 bulletList [ para "Foo" <> para "bar" ] <> bulletList [ para "Baz" ]
423423 ]
424+ -- Test that definition list requires a leading space.
425+ -- Emacs Muse does not require a space, we follow Amusewiki here.
426+ , "Not a definition list" =:
427+ T.unlines
428+ [ "First :: second"
429+ , "Foo :: bar"
430+ ] =?>
431+ para "First :: second Foo :: bar"
432+ , "Definition list" =:
433+ T.unlines
434+ [ " First :: second"
435+ , " Foo :: bar"
436+ ] =?>
437+ definitionList [ ("First", [ para "second" ])
438+ , ("Foo", [ para "bar" ])
439+ ]
440+ , "Definition list term cannot include newline" =:
441+ T.unlines
442+ [ " Foo" -- "Foo" is not a part of the definition list term
443+ , " Bar :: baz"
444+ ] =?>
445+ para "Foo" <>
446+ definitionList [ ("Bar", [ para "baz" ]) ]
447+ , "Multi-line definition lists" =:
448+ T.unlines
449+ [ " First term :: Definition of first term"
450+ , "and its continuation."
451+ , " Second term :: Definition of second term."
452+ ] =?>
453+ definitionList [ ("First term", [ para "Definition of first term and its continuation." ])
454+ , ("Second term", [ para "Definition of second term." ])
455+ ]
456+ -- Emacs Muse creates two separate lists when indentation of items is different.
457+ -- We follow Amusewiki and allow different indentation within one list.
458+ , "Changing indentation" =:
459+ T.unlines
460+ [ " First term :: Definition of first term"
461+ , "and its continuation."
462+ , " Second term :: Definition of second term."
463+ ] =?>
464+ definitionList [ ("First term", [ para "Definition of first term and its continuation." ])
465+ , ("Second term", [ para "Definition of second term." ])
466+ ]
467+ , "Two blank lines separate definition lists" =:
468+ T.unlines
469+ [ " First :: list"
470+ , ""
471+ , ""
472+ , " Second :: list"
473+ ] =?>
474+ definitionList [ ("First", [ para "list" ]) ] <>
475+ definitionList [ ("Second", [ para "list" ]) ]
424476 -- Headers in first column of list continuation are not allowed
425477 , "No headers in list continuation" =:
426478 T.unlines