From 1b5bfced558d28d45caadc6171f9e7448f3deae1 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 7 Aug 2017 07:43:59 +0300 Subject: Muse reader: debug indented paragraph support (#3839) Take only first line indentation into account and do not start new paragraph on indentation change. --- test/Tests/Readers/Muse.hs | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'test/Tests') diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 33fe2aeb3..c5c973f00 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -32,7 +32,7 @@ tests = [ testGroup "Inlines" [ "Plain String" =: "Hello, World" =?> - para (spcSep [ "Hello,", "World" ]) + para "Hello, World" , "Emphasis" =: "*Foo bar*" =?> para (emph . spcSep $ ["Foo", "bar"]) @@ -102,12 +102,35 @@ tests = , "5 dashes is a horizontal rule" =: "-----" =?> horizontalRule , "4 dashes with spaces is a horizontal rule" =: "---- " =?> horizontalRule ] + , testGroup "Paragraphs" + [ "Simple paragraph" =: + T.unlines [ "First line" + , "second line." + ] =?> + para "First line second line." + , "Indented paragraph" =: + T.unlines [ " First line" + , "second line." + ] =?> + para "First line second line." + -- Emacs Muse starts a blockquote on the second line. + -- We copy Amusewiki behavior and require a blank line to start a blockquote. + , "Indentation in the middle of paragraph" =: + T.unlines [ "First line" + , " second line" + , "third line" + ] =?> + para "First line second line third line" + , "Quote" =: + " This is a quotation\n" =?> + blockQuote (para "This is a quotation") + , "Multiline quote" =: + T.unlines [ " This is a quotation" + , " with a continuation" + ] =?> + blockQuote (para "This is a quotation with a continuation") + ] , "Quote tag" =: "Hello, world" =?> blockQuote (para $ text "Hello, world") - , "Quote" =: " This is a quotation\n" =?> blockQuote (para $ text "This is a quotation") - , "Multiline quote" =: T.unlines [ " This is a quotation" - , " with a continuation" - ] - =?> blockQuote (para $ text "This is a quotation with a continuation") , "Center" =: "
Hello, world
" =?> para (text "Hello, world") , "Right" =: "Hello, world" =?> para (text "Hello, world") , testGroup "Comments" -- cgit v1.2.3