diff --git a/src/Text/Pandoc/Readers/Djot.hs b/src/Text/Pandoc/Readers/Djot.hs index 7bf360172..ecfe3e2c1 100644 --- a/src/Text/Pandoc/Readers/Djot.hs +++ b/src/Text/Pandoc/Readers/Djot.hs @@ -186,7 +186,7 @@ convertInlines = fmap mconcat . mapM convertInline . F.toList . D.unMany convertInline :: PandocMonad m => D.Node D.Inline -> ReaderT Env m Inlines convertInline (D.Node pos attr il) = addAttrToInline pos attr <$> case il of - D.Str bs -> pure $ str (UTF8.toText bs) + D.Str bs -> pure $ text (UTF8.toText bs) D.Emph ils -> emph <$> convertInlines ils D.Strong ils -> strong <$> convertInlines ils D.Highlight ils -> spanWith ("",["mark"],[]) <$> convertInlines ils diff --git a/test/djot-reader.native b/test/djot-reader.native index bd0ae351f..8f7cc8174 100644 --- a/test/djot-reader.native +++ b/test/djot-reader.native @@ -2,15 +2,57 @@ Pandoc Meta { unMeta = fromList [] } [ Div ( "Pandoc-Test-Suite" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Pandoc Test Suite" ] + [ Header + 1 + ( "" , [] , [] ) + [ Str "Pandoc" , Space , Str "Test" , Space , Str "Suite" ] , Para - [ Str "John MacFarlane" , SoftBreak , Str "Anonymous" ] - , Para [ Str "July 17, 2006" ] - , Para - [ Str - "This is a set of tests for pandoc. Most of them are adapted from John Gruber\8217s" + [ Str "John" + , Space + , Str "MacFarlane" , SoftBreak - , Str "markdown test suite." + , Str "Anonymous" + ] + , Para + [ Str "July" , Space , Str "17," , Space , Str "2006" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "set" + , Space + , Str "of" + , Space + , Str "tests" + , Space + , Str "for" + , Space + , Str "pandoc." + , Space + , Str "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , Space + , Str "John" + , Space + , Str "Gruber\8217s" + , SoftBreak + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." ] , HorizontalRule ] @@ -22,10 +64,17 @@ Pandoc [ Header 2 ( "" , [] , [] ) - [ Str "Level 2 with an " + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Str "an" + , Space , Link ( "" , [] , [] ) - [ Str "embedded link" ] + [ Str "embedded" , Space , Str "link" ] ( "/url" , "" ) ] , Div @@ -33,55 +82,179 @@ Pandoc [ Header 3 ( "" , [] , [] ) - [ Str "Level 3 with " , Emph [ Str "emphasis" ] ] + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] , Div ( "level-4" , [ "section" ] , [] ) - [ Header 4 ( "" , [] , [] ) [ Str "Level 4" ] + [ Header + 4 + ( "" , [] , [] ) + [ Str "Level" , Space , Str "4" ] , Div ( "level-5" , [ "section" ] , [] ) - [ Header 5 ( "" , [] , [] ) [ Str "Level 5" ] ] + [ Header + 5 + ( "" , [] , [] ) + [ Str "Level" , Space , Str "5" ] + ] ] ] ] ] , Div ( "level-1" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Level 1" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Level" , Space , Str "1" ] , Div ( "level-2-with-emphasis" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) - [ Str "Level 2 with " , Emph [ Str "emphasis" ] ] + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] , Div ( "level-3" , [ "section" ] , [] ) - [ Header 3 ( "" , [] , [] ) [ Str "Level 3" ] - , Para [ Str "with no blank line" ] + [ Header + 3 ( "" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] ] ] , Div ( "level-2" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "Level 2" ] - , Para [ Str "with no blank line" ] + [ Header + 2 ( "" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] , HorizontalRule ] ] , Div ( "paragraphs" , [ "section" ] , [] ) [ Header 1 ( "" , [] , [] ) [ Str "Paragraphs" ] - , Para [ Str "Here\8217s a regular paragraph." ] , Para - [ Str - "In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item." + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." , SoftBreak - , Str - "Because a hard-wrapped line in the middle of a paragraph looked like a list" + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" , SoftBreak , Str "item." ] - , Para [ Str "Here\8217s one with a bullet. * criminey." ] , Para - [ Str "There should be a hard line break" + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" , LineBreak , Str "here." ] @@ -89,33 +262,97 @@ Pandoc ] , Div ( "block-quotes" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Block Quotes" ] - , Para [ Str "E-mail style:" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] , BlockQuote - [ Para [ Str "This is a block quote. It is pretty short." ] + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] ] , BlockQuote - [ Para [ Str "Code in a block quote:" ] + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] , CodeBlock ( "" , [ "" ] , [] ) "sub status {\n print \"working\";\n}\n" - , Para [ Str "A list:" ] + , Para [ Str "A" , Space , Str "list:" ] , OrderedList ( 1 , Decimal , Period ) - [ [ Plain [ Str "item one" ] ] - , [ Plain [ Str "item two" ] ] + [ [ Plain [ Str "item" , Space , Str "one" ] ] + , [ Plain [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" ] - , Para [ Str "Nested block quotes:" ] , BlockQuote [ Para [ Str "nested" ] ] , BlockQuote [ Para [ Str "nested" ] ] ] - , Para [ Str "This should not be a block quote: 2 > 1." ] - , Para [ Str "And a following paragraph." ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] , HorizontalRule ] , Div ( "code-blocks" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Code Blocks" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Code" , Space , Str "Blocks" ] , Para [ Str "Code:" ] , CodeBlock ( "" , [ "" ] , [] ) @@ -132,41 +369,41 @@ Pandoc , Div ( "unordered" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) [ Str "Unordered" ] - , Para [ Str "Asterisks tight:" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ [ Plain [ Str "asterisk 1" ] ] - , [ Plain [ Str "asterisk 2" ] ] - , [ Plain [ Str "asterisk 3" ] ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] ] - , Para [ Str "Asterisks loose:" ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ [ Para [ Str "asterisk 1" ] ] - , [ Para [ Str "asterisk 2" ] ] - , [ Para [ Str "asterisk 3" ] ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] ] - , Para [ Str "Pluses tight:" ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ [ Plain [ Str "Plus 1" ] ] - , [ Plain [ Str "Plus 2" ] ] - , [ Plain [ Str "Plus 3" ] ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] ] - , Para [ Str "Pluses loose:" ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ [ Para [ Str "Plus 1" ] ] - , [ Para [ Str "Plus 2" ] ] - , [ Para [ Str "Plus 3" ] ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] ] - , Para [ Str "Minuses tight:" ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ [ Plain [ Str "Minus 1" ] ] - , [ Plain [ Str "Minus 2" ] ] - , [ Plain [ Str "Minus 3" ] ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] ] - , Para [ Str "Minuses loose:" ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ [ Para [ Str "Minus 1" ] ] - , [ Para [ Str "Minus 2" ] ] - , [ Para [ Str "Minus 3" ] ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] ] ] , Div @@ -186,31 +423,76 @@ Pandoc , [ Plain [ Str "Two" ] ] , [ Plain [ Str "Three" ] ] ] - , Para [ Str "Loose using tabs:" ] + , Para + [ Str "Loose" + , Space + , Str "using" + , Space + , Str "tabs:" + ] , OrderedList ( 1 , Decimal , Period ) [ [ Para [ Str "First" ] ] , [ Para [ Str "Second" ] ] , [ Para [ Str "Third" ] ] ] - , Para [ Str "and using spaces:" ] + , Para + [ Str "and" + , Space + , Str "using" + , Space + , Str "spaces:" + ] , OrderedList ( 1 , Decimal , Period ) [ [ Para [ Str "One" ] ] , [ Para [ Str "Two" ] ] , [ Para [ Str "Three" ] ] ] - , Para [ Str "Multiple paragraphs:" ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList ( 1 , Decimal , Period ) - [ [ Para [ Str "Item 1, graf one." ] + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] , Para - [ Str - "Item 1. graf two. The quick brown fox jumped over the lazy dog\8217s back." + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , Space + , Str "back." ] ] - , [ Para [ Str "Item 2." ] ] - , [ Para [ Str "Item 3." ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] ] , Div @@ -225,7 +507,7 @@ Pandoc ] ] ] - , Para [ Str "Here\8217s another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList ( 1 , Decimal , Period ) [ [ Plain [ Str "First" ] ] @@ -238,7 +520,17 @@ Pandoc ] , [ Plain [ Str "Third" ] ] ] - , Para [ Str "Same thing but with paragraphs:" ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" + ] , OrderedList ( 1 , Decimal , Period ) [ [ Para [ Str "First" ] ] @@ -254,21 +546,85 @@ Pandoc ] , Div ( "tabs-and-spaces" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "Tabs and spaces" ] + [ Header + 2 + ( "" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ [ Para [ Str "this is a list item indented with tabs" ] + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] ] , [ Para - [ Str "this is a list item indented with spaces" ] + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] , BulletList [ [ Para - [ Str - "this is an example list item indented with tabs" + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" ] ] , [ Para - [ Str - "this is an example list item indented with spaces" + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" ] ] ] @@ -277,24 +633,61 @@ Pandoc ] , Div ( "fancy-list-markers" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "Fancy list markers" ] + [ Header + 2 + ( "" , [] , [] ) + [ Str "Fancy" + , Space + , Str "list" + , Space + , Str "markers" + ] , OrderedList ( 2 , Decimal , TwoParens ) - [ [ Para [ Str "begins with 2" ] ] - , [ Para [ Str "and now 3" ] - , Para [ Str "with a continuation" ] + [ [ Para + [ Str "begins" + , Space + , Str "with" + , Space + , Str "2" + ] + ] + , [ Para + [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "a" + , Space + , Str "continuation" + ] , OrderedList ( 4 , LowerRoman , Period ) [ [ Plain - [ Str - "sublist with roman numerals, starting with 4" + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" ] ] - , [ Plain [ Str "more items" ] + , [ Plain [ Str "more" , Space , Str "items" ] , OrderedList ( 1 , UpperAlpha , TwoParens ) - [ [ Plain [ Str "a subsublist" ] ] - , [ Plain [ Str "a subsublist" ] ] + [ [ Plain + [ Str "a" , Space , Str "subsublist" ] + ] + , [ Plain + [ Str "a" , Space , Str "subsublist" ] + ] ] ] ] @@ -303,17 +696,32 @@ Pandoc , Para [ Str "Nesting:" ] , OrderedList ( 1 , UpperAlpha , Period ) - [ [ Plain [ Str "Upper Alpha" ] + [ [ Plain [ Str "Upper" , Space , Str "Alpha" ] , OrderedList ( 1 , UpperRoman , Period ) - [ [ Plain [ Str "Upper Roman." ] + [ [ Plain [ Str "Upper" , Space , Str "Roman." ] , OrderedList ( 6 , Decimal , TwoParens ) - [ [ Plain [ Str "Decimal start with 6" ] + [ [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] , OrderedList ( 3 , LowerAlpha , OneParen ) [ [ Plain - [ Str "Lower alpha with paren" ] + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] ] ] ] @@ -332,7 +740,19 @@ Pandoc [ [ Plain [ Str "Nested." ] ] ] ] ] - , Para [ Str "Should not be a list item:" ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] , Para [ Str "M.A.\160\&2007" ] , OrderedList ( 2 , UpperAlpha , Period ) @@ -342,79 +762,166 @@ Pandoc ] , Div ( "definition-lists" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Definition Lists" ] - , Para [ Str "Tight using spaces:" ] + [ Header + 1 + ( "" , [] , [] ) + [ Str "Definition" , Space , Str "Lists" ] + , Para + [ Str "Tight" + , Space + , Str "using" + , Space + , Str "spaces:" + ] , DefinitionList - [ ( [ Str "apple" ] , [ [ Plain [ Str "red fruit" ] ] ] ) + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) , ( [ Str "orange" ] - , [ [ Plain [ Str "orange fruit" ] ] ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] ) , ( [ Str "banana" ] - , [ [ Plain [ Str "yellow fruit" ] ] ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] ) ] - , Para [ Str "Tight using tabs:" ] + , Para + [ Str "Tight" , Space , Str "using" , Space , Str "tabs:" ] , DefinitionList - [ ( [ Str "apple" ] , [ [ Plain [ Str "red fruit" ] ] ] ) + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) , ( [ Str "orange" ] - , [ [ Plain [ Str "orange fruit" ] ] ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] ) , ( [ Str "banana" ] - , [ [ Plain [ Str "yellow fruit" ] ] ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] ) ] , Para [ Str "Loose:" ] , DefinitionList - [ ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] ] ] ) - , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] ] ] ) - , ( [ Str "banana" ] , [ [ Para [ Str "yellow fruit" ] ] ] ) + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" ] - , Para [ Str "Multiple blocks with italics:" ] , DefinitionList [ ( [ Emph [ Str "apple" ] ] - , [ [ Para [ Str "red fruit" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] , Para - [ Str "contains seeds, crisp, pleasant to taste" ] + [ Str "contains" + , Space + , Str "seeds," + , Space + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] ] ] ) , ( [ Emph [ Str "orange" ] ] - , [ [ Para [ Str "orange fruit" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] , CodeBlock ( "" , [ "" ] , [] ) "{ orange code block }\n" - , BlockQuote [ Para [ Str "orange block quote" ] ] + , BlockQuote + [ Para + [ Str "orange" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] ] ] ) ] - , Para [ Str "Multiple definitions, tight:" ] - , DefinitionList - [ ( [ Str "apple" ] - , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] - ) - , ( [ Str "orange" ] - , [ [ Para [ Str "orange fruit" ] , Para [ Str "bank" ] ] ] - ) + , Para + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "tight:" ] - , Para [ Str "Multiple definitions, loose:" ] , DefinitionList [ ( [ Str "apple" ] - , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para [ Str "computer" ] + ] + ] ) , ( [ Str "orange" ] - , [ [ Para [ Str "orange fruit" ] , Para [ Str "bank" ] ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , Para [ Str "bank" ] + ] + ] ) ] , Para - [ Str - "Blank line after term, indented marker, alternate markers:" + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "loose:" ] , DefinitionList [ ( [ Str "apple" ] - , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para [ Str "computer" ] + ] + ] ) , ( [ Str "orange" ] - , [ [ Para [ Str "orange fruit" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , Para [ Str "bank" ] + ] + ] + ) + ] + , Para + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "after" + , Space + , Str "term," + , Space + , Str "indented" + , Space + , Str "marker," + , Space + , Str "alternate" + , Space + , Str "markers:" + ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para [ Str "computer" ] + ] + ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] , OrderedList ( 1 , Decimal , Period ) [ [ Plain [ Str "sublist" ] ] @@ -427,10 +934,29 @@ Pandoc ] , Div ( "html-blocks" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "HTML Blocks" ] - , Para [ Str "Simple block on one line:" ] + [ Header + 1 ( "" , [] , [] ) [ Str "HTML" , Space , Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] , Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] - , Para [ Str "And nested without indentation:" ] + , Para + [ Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] , Div ( "" , [] , [] ) [ Div @@ -438,29 +964,105 @@ Pandoc [ Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] ] , Div ( "" , [] , [] ) [ Para [ Str "bar" ] ] ] - , Para [ Str "Interpreted markdown in a table:" ] - , Para [ Str "This is " , Emph [ Str "emphasized" ] ] - , Para [ Str "And this is " , Strong [ Str "strong" ] ] - , Para [ Str "Here\8217s a simple block:" ] + , Para + [ Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + ] + , Para + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] , Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] - , Para [ Str "This should be a code block, though:" ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] , CodeBlock ( "" , [ "" ] , [] ) "
}\n"
, Para
- [ Str
- "If you want, you can indent every line, but you can also be lazy and just"
+ [ Str "If"
+ , Space
+ , Str "you"
+ , Space
+ , Str "want,"
+ , Space
+ , Str "you"
+ , Space
+ , Str "can"
+ , Space
+ , Str "indent"
+ , Space
+ , Str "every"
+ , Space
+ , Str "line,"
+ , Space
+ , Str "but"
+ , Space
+ , Str "you"
+ , Space
+ , Str "can"
+ , Space
+ , Str "also"
+ , Space
+ , Str "be"
+ , Space
+ , Str "lazy"
+ , Space
+ , Str "and"
+ , Space
+ , Str "just"
, SoftBreak
- , Str "indent the first line of each block."
+ , Str "indent"
+ , Space
+ , Str "the"
+ , Space
+ , Str "first"
+ , Space
+ , Str "line"
+ , Space
+ , Str "of"
+ , Space
+ , Str "each"
+ , Space
+ , Str "block."
]
]
- , Str " This should "
+ , Space
+ , Str "This"
+ , Space
+ , Str "should"
+ , Space
, Emph [ Str "not" ]
- , Str " be a"
+ , Space
+ , Str "be"
+ , Space
+ , Str "a"
, SoftBreak
- , Str
- "footnote reference, because it contains a space.[^my note] Here is an inline"
+ , Str "footnote"
+ , Space
+ , Str "reference,"
+ , Space
+ , Str "because"
+ , Space
+ , Str "it"
+ , Space
+ , Str "contains"
+ , Space
+ , Str "a"
+ , Space
+ , Str "space.[^my"
+ , Space
+ , Str "note]"
+ , Space
+ , Str "Here"
+ , Space
+ , Str "is"
+ , Space
+ , Str "an"
+ , Space
+ , Str "inline"
, SoftBreak
, Str "note."
, Note
[ Para
- [ Str "This is "
+ [ Str "This"
+ , Space
+ , Str "is"
+ , Space
, Emph [ Str "easier" ]
- , Str " to type. Inline notes may contain"
+ , Space
+ , Str "to"
+ , Space
+ , Str "type."
+ , Space
+ , Str "Inline"
+ , Space
+ , Str "notes"
+ , Space
+ , Str "may"
+ , Space
+ , Str "contain"
, SoftBreak
, Link
( "" , [] , [] )
[ Str "links" ]
( "http://google.com" , "" )
- , Str " and "
+ , Space
+ , Str "and"
+ , Space
, Code ( "" , [] , [] ) "]"
- , Str " verbatim characters, as well as"
+ , Space
+ , Str "verbatim"
+ , Space
+ , Str "characters,"
+ , Space
+ , Str "as"
+ , Space
+ , Str "well"
+ , Space
+ , Str "as"
, SoftBreak
- , Str "[bracketed text]."
+ , Str "[bracketed"
+ , Space
+ , Str "text]."
]
]
]
, BlockQuote
[ Para
- [ Str "Notes can go in quotes."
- , Note [ Para [ Str "In quote." ] ]
+ [ Str "Notes"
+ , Space
+ , Str "can"
+ , Space
+ , Str "go"
+ , Space
+ , Str "in"
+ , Space
+ , Str "quotes."
+ , Note [ Para [ Str "In" , Space , Str "quote." ] ]
]
]
, OrderedList
( 1 , Decimal , Period )
[ [ Plain
- [ Str "And in list items."
- , Note [ Para [ Str "In list." ] ]
+ [ Str "And"
+ , Space
+ , Str "in"
+ , Space
+ , Str "list"
+ , Space
+ , Str "items."
+ , Note [ Para [ Str "In" , Space , Str "list." ] ]
]
]
]
, Para
- [ Str
- "This paragraph should not be part of the note, as it is not indented."
+ [ Str "This"
+ , Space
+ , Str "paragraph"
+ , Space
+ , Str "should"
+ , Space
+ , Str "not"
+ , Space
+ , Str "be"
+ , Space
+ , Str "part"
+ , Space
+ , Str "of"
+ , Space
+ , Str "the"
+ , Space
+ , Str "note,"
+ , Space
+ , Str "as"
+ , Space
+ , Str "it"
+ , Space
+ , Str "is"
+ , Space
+ , Str "not"
+ , Space
+ , Str "indented."
]
]
]